NotesService: Replace noteByIdOrAlias with note as parameter

As the NotesController has the note already, because it checked with it if the user has the permission to perform the action, it's not necessary to get the note from the DB again, instead we should just provide the note to the functions directly.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-02-20 16:50:11 +01:00
parent c9b05b3c44
commit 5f49cb8d48
5 changed files with 50 additions and 107 deletions

View file

@ -206,7 +206,7 @@ describe('Notes', () => {
// wait one second
await new Promise((r) => setTimeout(r, 1000));
// update the note
await notesService.updateNoteByIdOrAlias('test5a', 'More test content');
await notesService.updateNote(note, 'More test content');
const metadata = await request(app.getHttpServer())
.get('/notes/test5a/metadata')
.expect(200);