mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix(server): Deleted shared users cause problem with album retrival and creation (#1002)
* fix(server): Deleted shared users cause problem with album retrival and creation * Remove dead code
This commit is contained in:
parent
2227a6f5f3
commit
cc697486fc
1 changed files with 16 additions and 2 deletions
|
@ -18,7 +18,14 @@ export class AlbumResponseDto {
|
|||
}
|
||||
|
||||
export function mapAlbum(entity: AlbumEntity): AlbumResponseDto {
|
||||
const sharedUsers = entity.sharedUsers?.map((userAlbum) => mapUser(userAlbum.userInfo)) || [];
|
||||
const sharedUsers: UserResponseDto[] = [];
|
||||
|
||||
entity.sharedUsers?.forEach((userAlbum) => {
|
||||
if (userAlbum.userInfo) {
|
||||
const user = mapUser(userAlbum.userInfo);
|
||||
sharedUsers.push(user);
|
||||
}
|
||||
});
|
||||
return {
|
||||
albumName: entity.albumName,
|
||||
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
||||
|
@ -33,7 +40,14 @@ export function mapAlbum(entity: AlbumEntity): AlbumResponseDto {
|
|||
}
|
||||
|
||||
export function mapAlbumExcludeAssetInfo(entity: AlbumEntity): AlbumResponseDto {
|
||||
const sharedUsers = entity.sharedUsers?.map((userAlbum) => mapUser(userAlbum.userInfo)) || [];
|
||||
const sharedUsers: UserResponseDto[] = [];
|
||||
|
||||
entity.sharedUsers?.forEach((userAlbum) => {
|
||||
if (userAlbum.userInfo) {
|
||||
const user = mapUser(userAlbum.userInfo);
|
||||
sharedUsers.push(user);
|
||||
}
|
||||
});
|
||||
return {
|
||||
albumName: entity.albumName,
|
||||
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
||||
|
|
Loading…
Reference in a new issue