| @@ 181-191 (lines=11) @@ | ||
| 178 | * @NoAdminRequired |
|
| 179 | * @NoCSRFRequired |
|
| 180 | */ |
|
| 181 | public function delete($id) { |
|
| 182 | $entity = $this->noteService->find($id); |
|
| 183 | if (!$entity) { |
|
| 184 | return new NotFoundJSONResponse(); |
|
| 185 | } |
|
| 186 | ||
| 187 | $this->noteService->delete($id); |
|
| 188 | $result = (object)['success' => true]; |
|
| 189 | \OC_Hook::emit('OCA\NextNote', 'post_delete_note', ['note_id' => $id]); |
|
| 190 | return new JSONResponse($result); |
|
| 191 | } |
|
| 192 | ||
| 193 | /** |
|
| 194 | * @param $note array |
|
| @@ 160-170 (lines=11) @@ | ||
| 157 | * @param $id |
|
| 158 | * @return NotFoundJSONResponse|UnauthorizedJSONResponse|JSONResponse |
|
| 159 | */ |
|
| 160 | public function delete($id) { |
|
| 161 | $entity = $this->notebookService->find($id); |
|
| 162 | if (!$entity) { |
|
| 163 | return new NotFoundJSONResponse(); |
|
| 164 | } |
|
| 165 | ||
| 166 | $this->notebookService->delete($id); |
|
| 167 | $result = (object)['success' => true]; |
|
| 168 | \OC_Hook::emit('OCA\NextNote', 'post_delete_notebook', ['notebook_id' => $id]); |
|
| 169 | return new JSONResponse($result); |
|
| 170 | } |
|
| 171 | } |
|
| 172 | ||