Fix unable to forget a shared note deleted by the owner. Issue #72

This commit is contained in:
Matias De lellis committed 2022-05-31 15:39:35 -03:00
1 parent 38860f784f
commit 073a8dbda1
5 files changed
+9 -12

No files matched your search

+3 -6
View File
@@ -54,12 +54,9 @@ class ShareController extends Controller {
*
* @param int $noteId
*/
public function destroy(int $noteId): JSONResponse {
if ($this->noteShareMapper->forgetShareByNoteIdAndSharedUser($noteId, $this->userId)) {
return new JSONResponse([], Http::STATUS_OK);
} else {
return new JSONResponse([], Http::STATUS_NOT_FOUND);
}
public function forget(int $noteId): JSONResponse {
$this->noteShareMapper->forgetShareByNoteIdAndSharedUser($noteId, $this->userId);
return new JSONResponse([]);
}
}