diff --git a/server/src/dtos/album.dto.ts b/server/src/dtos/album.dto.ts index 556f424c9f..276c1b9560 100644 --- a/server/src/dtos/album.dto.ts +++ b/server/src/dtos/album.dto.ts @@ -128,9 +128,10 @@ export const mapAlbum = (entity: AlbumEntity, withAssets: boolean, auth?: AuthDt if (entity.albumUsers) { for (const albumUser of entity.albumUsers) { - sharedUsers.push(mapUser(albumUser.user)); + const user = mapUser(albumUser.user); + sharedUsers.push(user); albumUsers.push({ - user: mapUser(albumUser.user), + user, role: albumUser.role, }); } diff --git a/server/src/services/album.service.ts b/server/src/services/album.service.ts index 764ff3136c..a3c3dc5e73 100644 --- a/server/src/services/album.service.ts +++ b/server/src/services/album.service.ts @@ -231,7 +231,7 @@ export class AlbumService { throw new BadRequestException('User not found'); } - album.albumUsers.push(await this.albumUserRepository.create({ userId: userId, albumId: id })); + await this.albumUserRepository.create({ userId: userId, albumId: id }); } return this.findOrFail(id, { withAssets: true }).then(mapAlbumWithoutAssets);