mirror of
https://github.com/immich-app/immich.git
synced 2025-03-11 02:23:09 -05: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 {
|
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 {
|
return {
|
||||||
albumName: entity.albumName,
|
albumName: entity.albumName,
|
||||||
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
||||||
|
@ -33,7 +40,14 @@ export function mapAlbum(entity: AlbumEntity): AlbumResponseDto {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mapAlbumExcludeAssetInfo(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 {
|
return {
|
||||||
albumName: entity.albumName,
|
albumName: entity.albumName,
|
||||||
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
albumThumbnailAssetId: entity.albumThumbnailAssetId,
|
||||||
|
|
Loading…
Add table
Reference in a new issue