committing WIP (improving error validation across the api's)

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-07-13 15:44:48 -04:00
committed by Julius Härtl
parent a388d199dc
commit 2668f6b80c
4 changed files with 77 additions and 39 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->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $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->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $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->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $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->entityHasError( $this->request->params['boardId'], 'board', $this->boardService );
$boardError = $this->apiHelper->boardHasError( $this->request->params['boardId'], $this->boardService );
if ($boardError) {
return new DataResponse($boardError['message'], $boardError['status']);