chore(server): make owner as required response for AlbumResponseDto (#1579)

This commit is contained in:
Alex 2023-02-07 15:11:14 -06:00 committed by GitHub
parent fb4969d5d1
commit 43fd7737f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 41 additions and 31 deletions

View file

@ -13,7 +13,7 @@ export class AlbumResponseDto {
shared!: boolean;
sharedUsers!: UserResponseDto[];
assets!: AssetResponseDto[];
owner?: UserResponseDto;
owner!: UserResponseDto;
@ApiProperty({ type: 'integer' })
assetCount!: number;
}
@ -35,7 +35,7 @@ export function mapAlbum(entity: AlbumEntity): AlbumResponseDto {
updatedAt: entity.updatedAt,
id: entity.id,
ownerId: entity.ownerId,
owner: entity.owner ? mapUser(entity.owner) : undefined,
owner: mapUser(entity.owner),
sharedUsers,
shared: sharedUsers.length > 0 || entity.sharedLinks?.length > 0,
assets: entity.assets?.map((assetAlbum) => mapAsset(assetAlbum.assetInfo)) || [],
@ -60,7 +60,7 @@ export function mapAlbumExcludeAssetInfo(entity: AlbumEntity): AlbumResponseDto
updatedAt: entity.updatedAt,
id: entity.id,
ownerId: entity.ownerId,
owner: entity.owner ? mapUser(entity.owner) : undefined,
owner: mapUser(entity.owner),
sharedUsers,
shared: sharedUsers.length > 0 || entity.sharedLinks?.length > 0,
assets: [],