quick test in StackApiController

Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
Ryan Fletcher
2018-07-12 10:43:46 -04:00
committed by Julius Härtl
parent 9fc01eb51f
commit 656e8efa43

View File

@@ -24,6 +24,7 @@
namespace OCA\Deck\Controller; namespace OCA\Deck\Controller;
use OCP\AppFramework\ApiController; use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest; use OCP\IRequest;
@@ -73,10 +74,18 @@ class StackApiController extends ApiController {
* Create a stack with the specified title and order. * Create a stack with the specified title and order.
*/ */
public function create($boardId, $title, $order) { public function create($boardId, $title, $order) {
// this throws a StatusException that needs to be caught and handled $errorMessage['params']['boardId'] = $boardId;
$stack = $this->service->create($title, $boardId, $order); $errorMessage['params']['title'] = $title;
$errorMessage['params']['order'] = $order;
return new DataResponse($stack); // try {
// // this throws a StatusException that needs to be caught and handled
// $stack = $this->service->create($title, $boardId, $order);
// } catch (StatusException $e) {
// return new DataResponse(null, Http::STATUS_OK);
// }
return new DataResponse($errorMessage, HTTP::STATUS_NOT_IMPLEMENTED);
} }
/** /**