mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-12-01 07:37:18 +01:00
Fix unable to forget shared note... Part of issue #72
This commit is contained in:
@@ -55,15 +55,11 @@ class ShareController extends Controller {
|
||||
* @param int $noteId
|
||||
*/
|
||||
public function destroy(int $noteId): JSONResponse {
|
||||
try {
|
||||
$noteShare = $this->noteShareMapper->findByNoteAndUser($noteId, $this->userId);
|
||||
} catch (DoesNotExistException $e) {
|
||||
if ($this->noteShareMapper->forgetShareByNoteIdAndSharedUser($noteId, $this->userId)) {
|
||||
return new JSONResponse([], Http::STATUS_OK);
|
||||
} else {
|
||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
|
||||
$this->noteShareMapper->delete($noteShare);
|
||||
|
||||
return new JSONResponse([]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user