fix: provide NoSuchNoteError error

This commit is contained in:
syuilo 2023-09-20 11:43:33 +09:00
parent 5d65e34078
commit fa13b815ef
2 changed files with 8 additions and 0 deletions

View file

@ -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,