Code Duplication    Length = 5-5 lines in 2 locations

controller/noteapicontroller.php 2 locations

@@ 128-132 (lines=5) @@
125
126
		if(!empty($notebook_id)){
127
			$notebook = $this->notebookService->find($notebook_id);
128
			if($notebook instanceof Notebook) {
129
				$note->setNotebook($notebook->getId());
130
			} else {
131
				return new JSONResponse(['error' => 'Notebook not found']);
132
			}
133
		}
134
135
		$result = $this->noteService->create($note)->jsonSerialize();
@@ 163-167 (lines=5) @@
160
		}
161
		if(!empty($notebook) && $notebook['id']){
162
			$notebook = $this->notebookService->find($notebook['id']);
163
			if($notebook instanceof Notebook) {
164
				$note->setNotebook($notebook->getId());
165
			} else {
166
				return new JSONResponse(['error' => 'Notebook not found']);
167
			}
168
		}
169
		$note->setName($title);
170
		$note->setNote($content);