StackApiController->delete($boardId, $id) added in error handling

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-07-12 21:17:04 -04:00
committed by Julius Härtl
parent be91ff641c
commit 03e0559afe

View File

@@ -123,10 +123,14 @@ class StackApiController extends ApiController {
*
* Delete the stack specified by $id. Return the board that was deleted.
*/
public function delete($boardId, $id) {
$stack = $this->service->delete($id);
public function delete($boardId, $stackId) {
$stack = $this->service->delete($stackId);
return new DataResponse($stack);
if ($stack == false || $stack == null) {
return new DataResponse("Stack Not Found", HTTP::STATUS_NOT_FOUND);
}
return new DataResponse($stack, HTTP::STATUS_OK);
}
}