src/Controller/Note/Delete.php 1 location
|
@@ 10-18 (lines=9) @@
|
7 |
|
use Slim\Http\Request; |
8 |
|
use Slim\Http\Response; |
9 |
|
|
10 |
|
class Delete extends Base |
11 |
|
{ |
12 |
|
public function __invoke(Request $request, Response $response, array $args): Response |
13 |
|
{ |
14 |
|
$this->deleteNoteService()->delete((int) $args['id']); |
15 |
|
|
16 |
|
return $this->jsonResponse($response, 'success', null, 204); |
17 |
|
} |
18 |
|
} |
19 |
|
|
src/Controller/Note/GetOne.php 1 location
|
@@ 10-18 (lines=9) @@
|
7 |
|
use Slim\Http\Request; |
8 |
|
use Slim\Http\Response; |
9 |
|
|
10 |
|
class GetOne extends Base |
11 |
|
{ |
12 |
|
public function __invoke(Request $request, Response $response, array $args): Response |
13 |
|
{ |
14 |
|
$note = $this->getOneNoteService()->getOne((int) $args['id']); |
15 |
|
|
16 |
|
return $this->jsonResponse($response, 'success', $note, 200); |
17 |
|
} |
18 |
|
} |
19 |
|
|
src/Controller/Note/Search.php 1 location
|
@@ 10-18 (lines=9) @@
|
7 |
|
use Slim\Http\Request; |
8 |
|
use Slim\Http\Response; |
9 |
|
|
10 |
|
class Search extends Base |
11 |
|
{ |
12 |
|
public function __invoke(Request $request, Response $response, array $args): Response |
13 |
|
{ |
14 |
|
$notes = $this->searchNoteService()->search($args['query']); |
15 |
|
|
16 |
|
return $this->jsonResponse($response, 'success', $notes, 200); |
17 |
|
} |
18 |
|
} |
19 |
|
|