So I found my own answer, fave_property_images
is not supposed to be an array, its just multiple strings. Therefore the following codes in function.php fixes the problem.
function add_fave_property_images() {
register_rest_field('property',
'fave_property_images',
array(
'get_callback' => 'get_property_images',
'update_callback' => 'update_property_images',
)
);
}
function get_property_images( $object ) {
//return the post meta
return get_post_meta( $object['id'], 'fave_property_images', false);
}
function update_property_images($value, $post, $field_name) {
// Update the field
foreach($value as $ID){
add_post_meta($post->ID, $field_name, $ID);
}
return;
}
add_action('rest_api_init', 'add_fave_property_images');