Undo deletion of boards via API.
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
7dcd49c485
commit
b4224dadfb
@@ -80,6 +80,7 @@ return [
|
|||||||
['name' => 'board_api#index', 'url' => '/api/v0.1/boards', 'verb' => 'GET'],
|
['name' => 'board_api#index', 'url' => '/api/v0.1/boards', 'verb' => 'GET'],
|
||||||
['name' => 'board_api#get', 'url' => '/api/v0.1/board/{id}', 'verb' => 'GET'],
|
['name' => 'board_api#get', 'url' => '/api/v0.1/board/{id}', 'verb' => 'GET'],
|
||||||
['name' => 'board_api#delete', 'url' => '/api/v0.1/board/{id}', 'verb' => 'DELETE'],
|
['name' => 'board_api#delete', 'url' => '/api/v0.1/board/{id}', 'verb' => 'DELETE'],
|
||||||
|
['name' => 'board_api#undo_delete', 'url' => '/api/v0.1/board/{id}/undo_delete', 'verb' => 'POST'],
|
||||||
|
|
||||||
['name' => 'board_api#preflighted_cors', 'url' => '/api/0.1/{path}',
|
['name' => 'board_api#preflighted_cors', 'url' => '/api/0.1/{path}',
|
||||||
'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']],
|
'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']],
|
||||||
|
|||||||
@@ -89,6 +89,18 @@ class BoardApiController extends ApiController {
|
|||||||
return (new DataResponse($board));
|
return (new DataResponse($board));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoAdminRequired
|
||||||
|
* @CORS
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*/
|
||||||
|
public function undoDelete($id) {
|
||||||
|
$board = $this->service->find($id);
|
||||||
|
$this->service->deleteUndo($id);
|
||||||
|
|
||||||
|
return (new DataResponse($board));
|
||||||
|
}
|
||||||
|
|
||||||
// this is taken from BoardController, but it's not ideal
|
// this is taken from BoardController, but it's not ideal
|
||||||
private function getUserInfo() {
|
private function getUserInfo() {
|
||||||
$groups = $this->groupManager->getUserGroupIds(
|
$groups = $this->groupManager->getUserGroupIds(
|
||||||
|
|||||||
Reference in New Issue
Block a user