Skip to content

Commit

Permalink
Merge pull request #6 from elevati/development
Browse files Browse the repository at this point in the history
API Params Validation to return proper status instead of 500
  • Loading branch information
Salil Kothadia authored Mar 6, 2017
2 parents 192fd43 + 032f8b4 commit 62a03f2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function get_items($request) {

# Param Validation
if (empty($args['post_type']) || !is_array($args['post_type'])) {
return new WP_Error('type_need_to_be_array', 'Type Param is a required parameter and needs to be an array: &type[]=post&type[]=page&type[]=slideshow');
return new WP_Error('type_need_to_be_array', 'Type Param is a required parameter and needs to be an array: &type[]=post&type[]=page&type[]=slideshow', ['status' => 422]);
}

$args['date_query'] = array();
Expand Down

0 comments on commit 62a03f2

Please sign in to comment.