Board creation via API.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Steven R. Baker
2017-07-29 23:02:05 +02:00
committed by Julius Härtl
parent 86dde2d6b8
commit 8316a0b25f
2 changed files with 17 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ return [
// api // api
['name' => 'board_api#index', 'url' => '/api/v1.0/boards', 'verb' => 'GET'], ['name' => 'board_api#index', 'url' => '/api/v1.0/boards', 'verb' => 'GET'],
['name' => 'board_api#get', 'url' => '/api/v1.0/board/{id}', 'verb' => 'GET'], ['name' => 'board_api#get', 'url' => '/api/v1.0/board/{id}', 'verb' => 'GET'],
['name' => 'board_api#create', 'url' => '/api/v1.0/board', 'verb' => 'POST'],
['name' => 'board_api#delete', 'url' => '/api/v1.0/board/{id}', 'verb' => 'DELETE'], ['name' => 'board_api#delete', 'url' => '/api/v1.0/board/{id}', 'verb' => 'DELETE'],
['name' => 'board_api#undo_delete', 'url' => '/api/v1.0/board/{id}/undo_delete', 'verb' => 'POST'], ['name' => 'board_api#undo_delete', 'url' => '/api/v1.0/board/{id}/undo_delete', 'verb' => 'POST'],

View File

@@ -87,6 +87,22 @@ class BoardApiController extends ApiController {
return new DataResponse($board); return new DataResponse($board);
} }
/**
* @NoAdminRequired
* @CORS
* @NoCSRFRequired
*
* @params $title
* @params $color
*
* Create a board with the specified title and color.
*/
public function create($title, $color) {
$board = $this->service->create($title, $this->userId, $color);
return new DataResponse($board);
}
/** /**
* @NoAdminRequired * @NoAdminRequired
* @CORS * @CORS