Added exception handling to BoardApiController -> Delete
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
committed by
Julius Härtl
parent
9bc9569a0d
commit
3b49c7f262
@@ -113,7 +113,11 @@ class BoardApiController extends ApiController {
|
|||||||
public function delete($id) {
|
public function delete($id) {
|
||||||
$board = $this->service->delete($id);
|
$board = $this->service->delete($id);
|
||||||
|
|
||||||
return new DataResponse($board);
|
if ($board === false || $board === null) {
|
||||||
|
return new DataResponse('Board not found', HTTP::STATUS_NOT_FOUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new DataResponse($board, HTTP::STATUS_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user