Message improves
This commit is contained in:
parent
e4175f83ab
commit
f4d4d0312a
|
@ -170,11 +170,9 @@ class TAINACAN_REST_Collections_Controller extends WP_REST_Controller {
|
|||
}
|
||||
|
||||
return new WP_REST_Response([
|
||||
[
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $prepared_post->get_errors()
|
||||
],
|
||||
$prepared_post->__toJSON()
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $prepared_post->get_errors(),
|
||||
'collection' => $prepared_post->__toJSON()
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
|
|
@ -198,11 +198,9 @@ class TAINACAN_REST_Items_Controller extends WP_REST_Controller {
|
|||
|
||||
|
||||
return new WP_REST_Response([
|
||||
[
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $item->get_errors()
|
||||
],
|
||||
$item->__toJSON()
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $item->get_errors(),
|
||||
'item' => $item->__toJSON()
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
|
|
@ -125,11 +125,9 @@ class TAINACAN_REST_Metadata_Controller extends WP_REST_Controller {
|
|||
}
|
||||
} else {
|
||||
return new WP_REST_Response([
|
||||
[
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $this->metadata->get_errors()
|
||||
],
|
||||
$this->metadata->__toJSON(),
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $this->metadata->get_errors(),
|
||||
'metadata' => $this->metadata->__toJSON(),
|
||||
], 400);
|
||||
}
|
||||
} elseif (!empty($request['item_id']) && !empty($request->get_body())){
|
||||
|
@ -150,12 +148,10 @@ class TAINACAN_REST_Metadata_Controller extends WP_REST_Controller {
|
|||
|
||||
return new WP_REST_Response( $metadata_updated->__toJSON(), 201 );
|
||||
} else {
|
||||
return new WP_REST_Response( [
|
||||
[
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $item_metadata->get_errors()
|
||||
],
|
||||
$item_metadata->__toJSON(),
|
||||
return new WP_REST_Response([
|
||||
'error_message' => __('One or more values are invalid.', 'tainacan'),
|
||||
'errors' => $item_metadata->get_errors(),
|
||||
'item_metadata' => $item_metadata->__toJSON(),
|
||||
], 400);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue