diff --git a/app/library/App/Controllers/ProjectController.php b/app/library/App/Controllers/ProjectController.php index 309ce13..852c950 100644 --- a/app/library/App/Controllers/ProjectController.php +++ b/app/library/App/Controllers/ProjectController.php @@ -23,4 +23,21 @@ class ProjectController extends CrudResourceController { } + public function find($id) + { + $item = $this->getFindData($id); + + if (!$item) { + return $this->onItemNotFound($id); + } + + if (!$this->findAllowed($id, $item)) { + return $this->onNotAllowed(); + } + + $response = $this->getFindResponse($item); + + return '123'; + } + } \ No newline at end of file diff --git a/app/library/App/Resources/ProjectResource.php b/app/library/App/Resources/ProjectResource.php index f70d05a..755fb5c 100644 --- a/app/library/App/Resources/ProjectResource.php +++ b/app/library/App/Resources/ProjectResource.php @@ -30,14 +30,13 @@ class ProjectResource extends ApiResource { ->collectionKey('projects') ; - /** transformers **/ + /** transformer **/ $this ->transformer(ProjectTransformer::class); - /** handlers **/ + /** handler **/ $this ->handler(ProjectController::class); - //->handler(CrudResourceController::class); /** general roles **/ $this @@ -46,7 +45,7 @@ class ProjectResource extends ApiResource { /** endpoints **/ $this ->endpoint(ApiEndpoint::post('/test', 'test') - ->description('Returns the currently logged in user') + ->description('Just for test') ) ->endpoint(ApiEndpoint::all()) ->endpoint(ApiEndpoint::create()) -- libgit2 0.21.4