From 2b14ad92cd49e5fa2e44193e3055d8edd1b1e70c Mon Sep 17 00:00:00 2001 From: David Mehren Date: Tue, 23 Feb 2021 21:14:39 +0100 Subject: [PATCH] Don't await non-Promises Signed-off-by: David Mehren --- src/api/public/me/me.controller.ts | 2 +- src/api/public/notes/notes.controller.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/public/me/me.controller.ts b/src/api/public/me/me.controller.ts index dc46d647d..db5d48626 100644 --- a/src/api/public/me/me.controller.ts +++ b/src/api/public/me/me.controller.ts @@ -102,7 +102,7 @@ export class MeController { @UseGuards(TokenAuthGuard) @Get('notes') async getMyNotes(@Request() req): Promise { - const notes = await this.notesService.getUserNotes(req.user); + const notes = this.notesService.getUserNotes(req.user); return await Promise.all( notes.map((note) => this.notesService.toNoteMetadataDto(note)), ); diff --git a/src/api/public/notes/notes.controller.ts b/src/api/public/notes/notes.controller.ts index e94cb3a57..da3baab93 100644 --- a/src/api/public/notes/notes.controller.ts +++ b/src/api/public/notes/notes.controller.ts @@ -221,7 +221,7 @@ export class NotesController { throw new UnauthorizedException('Updating note denied!'); } return await this.noteService.toNotePermissionsDto( - await this.noteService.updateNotePermissions(note, updateDto), + this.noteService.updateNotePermissions(note, updateDto), ); } catch (e) { if (e instanceof NotInDBError) {