mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
refactor(media-upload): lazy-load relations
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
4d57105853
commit
296d73c121
9 changed files with 39 additions and 30 deletions
|
@ -72,7 +72,9 @@ export class NotesController {
|
|||
@UseGuards(PermissionsGuard)
|
||||
async getNotesMedia(@RequestNote() note: Note): Promise<MediaUploadDto[]> {
|
||||
const media = await this.mediaService.listUploadsByNote(note);
|
||||
return media.map((media) => this.mediaService.toMediaUploadDto(media));
|
||||
return await Promise.all(
|
||||
media.map((media) => this.mediaService.toMediaUploadDto(media)),
|
||||
);
|
||||
}
|
||||
|
||||
@Post()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue