diff --git a/lib/Controller/NoteApiController.php b/lib/Controller/NoteApiController.php index acf0120..dbc1bc2 100644 --- a/lib/Controller/NoteApiController.php +++ b/lib/Controller/NoteApiController.php @@ -137,8 +137,8 @@ class NoteApiController extends ApiController { * @param string $color * @param bool $isPinned * @param array $tags - * @param array $sharedWith * @param array $attachments + * @param array $sharedWith */ public function update(int $id, string $title, @@ -146,8 +146,8 @@ class NoteApiController extends ApiController { string $color, bool $isPinned, array $tags, - array $sharedWith, - array $attachments): JSONResponse + array $attachments, + array $sharedWith): JSONResponse { $note = $this->noteService->update($this->userId, $id, @@ -156,8 +156,8 @@ class NoteApiController extends ApiController { $color, $isPinned, $tags, - $sharedWith, - $attachments); + $attachments, + $sharedWith); if (is_null($note)) { return new JSONResponse([], Http::STATUS_NOT_FOUND); diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index ce40300..476ab97 100644 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -129,8 +129,8 @@ class NoteController extends Controller { * @param string $color * @param bool $isPinned * @param array $tags - * @param array $sharedWith * @param array $attachments + * @param array $sharedWith */ public function update(int $id, string $title, @@ -138,8 +138,8 @@ class NoteController extends Controller { string $color, bool $isPinned, array $tags, - array $sharedWith, - array $attachments): JSONResponse + array $attachments, + array $sharedWith): JSONResponse { $note = $this->noteService->update($this->userId, $id, @@ -148,8 +148,8 @@ class NoteController extends Controller { $color, $isPinned, $tags, - $sharedWith, - $attachments); + $attachments, + $sharedWith); if (is_null($note)) { return new JSONResponse([], Http::STATUS_NOT_FOUND); diff --git a/lib/Service/NoteService.php b/lib/Service/NoteService.php index f47eba4..9e0a96c 100644 --- a/lib/Service/NoteService.php +++ b/lib/Service/NoteService.php @@ -211,9 +211,9 @@ class NoteService { * @param string $content * @param string $color * @param bool $isPinned - * @param array $sharedWith * @param array $tags * @param array $attachments + * @param array $sharedWith */ public function update(string $userId, int $id, @@ -221,9 +221,9 @@ class NoteService { string $content, string $color, bool $isPinned, - array $sharedWith, array $tags, - array $attachments): ?Note + array $attachments, + array $sharedWith): ?Note { // Get current Note and Color. $note = $this->get($userId, $id); @@ -272,7 +272,7 @@ class NoteService { $dbShares = $this->noteShareMapper->getSharesForNote($id); foreach ($dbShares as $dbShare) { $delete = true; - foreach ($shares as $share) { + foreach ($sharedWith as $share) { if ($dbShare->getSharedUser() === $share['shared_user']) { $delete = false; break;