mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
ESLint: Enable @typescript-eslint/return-await rule
This ensures stack traces are helpful at the cost of a slightly lower performance (one more tick in the event loop). Fixes #838 Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
6a6dc7ea21
commit
6ffeb2e9c9
8 changed files with 26 additions and 20 deletions
|
@ -53,7 +53,7 @@ export class MeController {
|
|||
@Get('history')
|
||||
async getUserHistory(@Request() req): Promise<HistoryEntryDto[]> {
|
||||
const foundEntries = await this.historyService.getEntriesByUser(req.user);
|
||||
return Promise.all(
|
||||
return await Promise.all(
|
||||
foundEntries.map(
|
||||
async (entry) => await this.historyService.toHistoryEntryDto(entry),
|
||||
),
|
||||
|
@ -69,7 +69,7 @@ export class MeController {
|
|||
): Promise<HistoryEntryDto> {
|
||||
// ToDo: Check if user is allowed to pin this history entry
|
||||
try {
|
||||
return this.historyService.toHistoryEntryDto(
|
||||
return await this.historyService.toHistoryEntryDto(
|
||||
await this.historyService.updateHistoryEntry(
|
||||
note,
|
||||
req.user,
|
||||
|
@ -103,7 +103,7 @@ export class MeController {
|
|||
@Get('notes')
|
||||
async getMyNotes(@Request() req): Promise<NoteMetadataDto[]> {
|
||||
const notes = await this.notesService.getUserNotes(req.user);
|
||||
return Promise.all(
|
||||
return await Promise.all(
|
||||
notes.map((note) => this.notesService.toNoteMetadataDto(note)),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue