Code Duplication    Length = 11-11 lines in 2 locations

controller/noteapicontroller.php 1 location

@@ 183-193 (lines=11) @@
180
	 * @NoAdminRequired
181
	 * @NoCSRFRequired
182
	 */
183
	public function delete($id) {
184
		$entity = $this->noteService->find($id);
185
		if (!$entity) {
186
			return new NotFoundJSONResponse();
187
		}
188
189
		$this->noteService->delete($id);
190
		$result = (object)['success' => true];
191
		\OC_Hook::emit('OCA\NextNote', 'post_delete_note', ['note_id' => $id]);
192
		return new JSONResponse($result);
193
	}
194
195
	/**
196
	 * @param $note array

controller/notebookapicontroller.php 1 location

@@ 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