Add ability to sort tasks by completed_at attribute (#1021)

This commit is contained in:
Régis Freyd
2018-03-20 20:58:22 -04:00
committed by GitHub
parent 8e7c032ea5
commit 8be4c15e90
5 changed files with 39 additions and 11 deletions
@@ -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.