mirror of
https://github.com/immich-app/immich.git
synced 2025-03-01 15:11:21 +01:00
fix(web): incorrect shared album count (#677)
This commit is contained in:
parent
011332e509
commit
9e4ed2214b
1 changed files with 7 additions and 2 deletions
|
@ -50,9 +50,14 @@ export class AlbumRepository implements IAlbumRepository {
|
||||||
where: { sharedUserId: userId },
|
where: { sharedUserId: userId },
|
||||||
});
|
});
|
||||||
|
|
||||||
const sharingAlbums = ownedAlbums.map((album) => album.sharedUsers?.length || 0).reduce((a, b) => a + b, 0);
|
let sharedAlbumCount = 0;
|
||||||
|
ownedAlbums.map((album) => {
|
||||||
|
if (album.sharedUsers?.length) {
|
||||||
|
sharedAlbumCount += 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return new AlbumCountResponseDto(ownedAlbums.length, sharedAlbums, sharingAlbums);
|
return new AlbumCountResponseDto(ownedAlbums.length, sharedAlbums, sharedAlbumCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
async create(ownerId: string, createAlbumDto: CreateAlbumDto): Promise<AlbumEntity> {
|
async create(ownerId: string, createAlbumDto: CreateAlbumDto): Promise<AlbumEntity> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue