diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-20 11:43:33 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-20 11:43:33 +0900 |
| commit | fa13b815ef8412db592e6cb4926cf2dde32f1c0b (patch) | |
| tree | 0046b6a8c52de51b0003d7a955ae6298ba1c9a3b /packages/backend/src/core/ClipService.ts | |
| parent | fix import (diff) | |
| download | sharkey-fa13b815ef8412db592e6cb4926cf2dde32f1c0b.tar.gz sharkey-fa13b815ef8412db592e6cb4926cf2dde32f1c0b.tar.bz2 sharkey-fa13b815ef8412db592e6cb4926cf2dde32f1c0b.zip | |
fix: provide NoSuchNoteError error
Diffstat (limited to 'packages/backend/src/core/ClipService.ts')
| -rw-r--r-- | packages/backend/src/core/ClipService.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/backend/src/core/ClipService.ts b/packages/backend/src/core/ClipService.ts index 5dfb3b33a6..3d9982e80f 100644 --- a/packages/backend/src/core/ClipService.ts +++ b/packages/backend/src/core/ClipService.ts @@ -143,6 +143,12 @@ export class ClipService { throw new ClipService.NoSuchClipError(); } + const note = await this.notesRepository.findOneBy({ id: noteId }); + + if (note == null) { + throw new ClipService.NoSuchNoteError(); + } + await this.clipNotesRepository.delete({ noteId: noteId, clipId: clip.id, |