fix: album performances
This commit is contained in:
parent
5c0821330f
commit
202e2174a2
2 changed files with 5 additions and 1 deletions
|
@ -81,7 +81,7 @@ export class AlbumService {
|
|||
async get(authUser: AuthUserDto, id: string, dto: AlbumInfoDto): Promise<AlbumResponseDto> {
|
||||
await this.access.requirePermission(authUser, Permission.ALBUM_READ, id);
|
||||
await this.albumRepository.updateThumbnails();
|
||||
return mapAlbum(await this.findOrFail(id, { withAssets: true }), !dto.withoutAssets);
|
||||
return mapAlbum(await this.findOrFail(id, { withAssets: false }), !dto.withoutAssets);
|
||||
}
|
||||
|
||||
async create(authUser: AuthUserDto, dto: CreateAlbumDto): Promise<AlbumResponseDto> {
|
||||
|
|
|
@ -56,6 +56,7 @@ export class AlbumRepository implements IAlbumRepository {
|
|||
],
|
||||
relations: { owner: true, sharedUsers: true },
|
||||
order: { createdAt: 'DESC' },
|
||||
relationLoadStrategy: 'query',
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -91,6 +92,7 @@ export class AlbumRepository implements IAlbumRepository {
|
|||
relations: { sharedUsers: true, sharedLinks: true, owner: true },
|
||||
where: { ownerId },
|
||||
order: { createdAt: 'DESC' },
|
||||
relationLoadStrategy: 'query',
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -106,6 +108,7 @@ export class AlbumRepository implements IAlbumRepository {
|
|||
{ ownerId, sharedUsers: { id: Not(IsNull()) } },
|
||||
],
|
||||
order: { createdAt: 'DESC' },
|
||||
relationLoadStrategy: 'query',
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -117,6 +120,7 @@ export class AlbumRepository implements IAlbumRepository {
|
|||
relations: { sharedUsers: true, sharedLinks: true, owner: true },
|
||||
where: { ownerId, sharedUsers: { id: IsNull() }, sharedLinks: { id: IsNull() } },
|
||||
order: { createdAt: 'DESC' },
|
||||
relationLoadStrategy: 'query',
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue