HistoryService: toHistoryEntryDto does not need to be async

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-24 21:19:48 +01:00
parent bfa5f0dfc6
commit 616f963b8e
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 5 additions and 7 deletions

View file

@ -55,9 +55,7 @@ export class MeController {
async getUserHistory(@Req() req: Request): Promise<HistoryEntryDto[]> {
const foundEntries = await this.historyService.getEntriesByUser(req.user);
return await Promise.all(
foundEntries.map(
async (entry) => await this.historyService.toHistoryEntryDto(entry),
),
foundEntries.map((entry) => this.historyService.toHistoryEntryDto(entry)),
);
}
@ -70,7 +68,7 @@ export class MeController {
): Promise<HistoryEntryDto> {
// ToDo: Check if user is allowed to pin this history entry
try {
return await this.historyService.toHistoryEntryDto(
return this.historyService.toHistoryEntryDto(
await this.historyService.updateHistoryEntry(
note,
req.user,