Add ability to sort tasks by completed_at attribute (#1021)
This commit is contained in:
@@ -170,6 +170,8 @@ class ApiController extends Controller
|
||||
'updated_at',
|
||||
'-created_at',
|
||||
'-updated_at',
|
||||
'completed_at',
|
||||
'-completed_at',
|
||||
];
|
||||
|
||||
if (in_array($criteria, $acceptedCriteria)) {
|
||||
@@ -221,6 +223,17 @@ class ApiController extends Controller
|
||||
->respondWithError($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a response invalid query to the request.
|
||||
* @param string $message
|
||||
*/
|
||||
public function respondInvalidQuery($message = 'Invalid query')
|
||||
{
|
||||
return $this->setHTTPStatusCode(500)
|
||||
->setErrorCode(40)
|
||||
->respondWithError($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an error when the query didn't have the right parameters for
|
||||
* creating an object.
|
||||
|
||||
Reference in New Issue
Block a user