Error handling for StackApiController->Index()
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
committed by
Julius Härtl
parent
0da84a3e8c
commit
cec06493c0
@@ -60,7 +60,12 @@ class StackApiController extends ApiController {
|
|||||||
*/
|
*/
|
||||||
public function index($boardId) {
|
public function index($boardId) {
|
||||||
$stacks = $this->service->findAll($boardId);
|
$stacks = $this->service->findAll($boardId);
|
||||||
return new DataResponse($stacks);
|
|
||||||
|
if ($stacks === false || $stacks === null) {
|
||||||
|
return new DataResponse("No Stacks Found", HTTP::STATUS_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new DataResponse($stacks, HTTP::STATUS_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user