mirror of
https://github.com/JanGross/quicknotes.git
synced 2025-11-30 23:37:16 +01:00
delete share if note is deleted
This commit is contained in:
@@ -167,6 +167,8 @@ class NoteController extends Controller {
|
||||
}
|
||||
$oldcolorid = $note->getColorId();
|
||||
|
||||
$this->notesharemapper->deleteByNoteId($note->getId());
|
||||
|
||||
// Delete note.
|
||||
$this->notemapper->delete($note);
|
||||
|
||||
@@ -178,4 +180,4 @@ class NoteController extends Controller {
|
||||
|
||||
return new DataResponse($note);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +25,9 @@ class NoteShareMapper extends Mapper {
|
||||
$sql = 'SELECT * FROM *PREFIX*quicknotes_shares WHERE shared_group = ?';
|
||||
return $this->findEntities($sql, [$groupId]);
|
||||
}
|
||||
|
||||
public function deleteByNoteId($noteId) {
|
||||
$sql = 'DELETE FROM *PREFIX*quicknotes_shares WHERE note_id = ?';
|
||||
$this->execute($sql, [$noteId]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user