Finished Error handling across the API

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-07-13 19:07:08 -04:00
committed by Julius Härtl
parent 2668f6b80c
commit dd1d4246fe
5 changed files with 34 additions and 44 deletions

View File

@@ -66,7 +66,7 @@ class StackApiController extends ApiController {
* Return all of the stacks in the specified board.
*/
public function index() {
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $this->boardService );
$boardError = $this->apiHelper->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
if ($boardError) {
return new DataResponse($boardError['message'], $boardError['status']);
@@ -95,7 +95,7 @@ class StackApiController extends ApiController {
*/
public function create($title, $order) {
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $this->boardService );
$boardError = $this->apiHelper->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
if ($boardError) {
return new DataResponse($boardError['message'], $boardError['status']);
@@ -127,7 +127,7 @@ class StackApiController extends ApiController {
*/
public function update($title, $order) {
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $this->boardService );
$boardError = $this->apiHelper->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
if ($boardError) {
return new DataResponse($boardError['message'], $boardError['status']);
@@ -163,7 +163,7 @@ class StackApiController extends ApiController {
*/
public function delete() {
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $this->boardService );
$boardError = $this->apiHelper->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
if ($boardError) {
return new DataResponse($boardError['message'], $boardError['status']);