chore(server): set relations for getByIds (#4855)

This commit is contained in:
Mert
2023-11-05 21:15:12 -05:00
committed by GitHub
parent a0743d8b7d
commit 9e7a32804b
3 changed files with 17 additions and 7 deletions

View File

@@ -104,10 +104,9 @@ export class AssetRepository implements IAssetRepository {
.getMany();
}
getByIds(ids: string[]): Promise<AssetEntity[]> {
return this.repository.find({
where: { id: In(ids) },
relations: {
getByIds(ids: string[], relations?: FindOptionsRelations<AssetEntity>): Promise<AssetEntity[]> {
if (!relations) {
relations = {
exifInfo: true,
smartInfo: true,
tags: true,
@@ -115,7 +114,11 @@ export class AssetRepository implements IAssetRepository {
person: true,
},
stack: true,
},
};
}
return this.repository.find({
where: { id: In(ids) },
relations,
withDeleted: true,
});
}