mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Don't await non-Promises
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
cc010ddf2a
commit
e4ba59f154
2 changed files with 2 additions and 2 deletions
|
@ -102,7 +102,7 @@ export class MeController {
|
||||||
@UseGuards(TokenAuthGuard)
|
@UseGuards(TokenAuthGuard)
|
||||||
@Get('notes')
|
@Get('notes')
|
||||||
async getMyNotes(@Request() req): Promise<NoteMetadataDto[]> {
|
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(
|
return await Promise.all(
|
||||||
notes.map((note) => this.notesService.toNoteMetadataDto(note)),
|
notes.map((note) => this.notesService.toNoteMetadataDto(note)),
|
||||||
);
|
);
|
||||||
|
|
|
@ -221,7 +221,7 @@ export class NotesController {
|
||||||
throw new UnauthorizedException('Updating note denied!');
|
throw new UnauthorizedException('Updating note denied!');
|
||||||
}
|
}
|
||||||
return await this.noteService.toNotePermissionsDto(
|
return await this.noteService.toNotePermissionsDto(
|
||||||
await this.noteService.updateNotePermissions(note, updateDto),
|
this.noteService.updateNotePermissions(note, updateDto),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof NotInDBError) {
|
if (e instanceof NotInDBError) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue