diff --git a/src/notes/notes.service.ts b/src/notes/notes.service.ts index 012a3898c..8e1f11284 100644 --- a/src/notes/notes.service.ts +++ b/src/notes/notes.service.ts @@ -195,6 +195,7 @@ export class NotesService { revisions.push(Revision.create(noteContent, noteContent)); note.revisions = Promise.resolve(revisions); await this.noteRepository.save(note); + return this.toNoteDto(note); } async getNoteMetadata(noteIdOrAlias: string): Promise { diff --git a/test/public-api/notes.e2e-spec.ts b/test/public-api/notes.e2e-spec.ts index 1846511ee..38b2db779 100644 --- a/test/public-api/notes.e2e-spec.ts +++ b/test/public-api/notes.e2e-spec.ts @@ -109,7 +109,7 @@ describe('Notes', () => { it(`PUT /notes/{note}`, async () => { await notesService.createNote('This is a test note.', 'test4'); - await request(app.getHttpServer()) + const response = await request(app.getHttpServer()) .put('/notes/test4') .set('Content-Type', 'text/markdown') .send('New note text') @@ -117,6 +117,7 @@ describe('Notes', () => { await expect( (await notesService.getNoteDtoByIdOrAlias('test4')).content, ).toEqual('New note text'); + expect(response.body.content).toEqual('New note text'); // check if a missing note correctly returns 404 await request(app.getHttpServer())