mirror of
https://github.com/immich-app/immich.git
synced 2026-02-11 11:27:56 +03:00
small optimizations
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user