mirror of
https://github.com/immich-app/immich.git
synced 2024-11-15 09:59:00 -07:00
feat(server): include shared albums in getByAssetId (#3978)
This commit changes the album.getByAssetId API to also consider albums that have been shared with the current user. This way when the user is browing their timeline and clicks to show the asset details they will see if the asset appears in not only their own albums but also albums shared with them.
This commit is contained in:
parent
54775b896f
commit
26bc889f8d
@ -50,7 +50,10 @@ export class AlbumRepository implements IAlbumRepository {
|
||||
|
||||
getByAssetId(ownerId: string, assetId: string): Promise<AlbumEntity[]> {
|
||||
return this.repository.find({
|
||||
where: { ownerId, assets: { id: assetId } },
|
||||
where: [
|
||||
{ ownerId, assets: { id: assetId } },
|
||||
{ sharedUsers: { id: ownerId }, assets: { id: assetId } },
|
||||
],
|
||||
relations: { owner: true, sharedUsers: true },
|
||||
order: { createdAt: 'DESC' },
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user