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 committed by David Mehren
parent e538056252
commit 4d89ffd474
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
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);