From a2321aea11803d925a6463c40b0501889439c123 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 8 Feb 2017 17:28:33 +0200 Subject: [PATCH] test --- app/library/App/Controllers/ProjectController.php | 17 +++++++++++++++++ app/library/App/Resources/ProjectResource.php | 7 +++---- 2 files changed, 20 insertions(+), 4 deletions(-) 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