Don't await non-Promises

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-23 21:14:39 +01:00
parent f3f0360a95
commit 2b14ad92cd
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 2 additions and 2 deletions

View file

@ -102,7 +102,7 @@ export class MeController {
@UseGuards(TokenAuthGuard)
@Get('notes')
async getMyNotes(@Request() req): Promise<NoteMetadataDto[]> {
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)),
);

View file

@ -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) {