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 },
|
||||
});
|
||||
|
||||
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> {
|
||||
|
|
Loading…
Reference in a new issue