fix(server): checkExistingAssets (#10192)

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Michel Heusschen
2024-06-12 15:48:44 +02:00
committed by GitHub
parent 52170423be
commit 9dbf5db72e
5 changed files with 37 additions and 7 deletions

View File

@@ -155,8 +155,8 @@ export class AssetRepository implements IAssetRepository {
});
}
getByDeviceIds(ownerId: string, deviceId: string, deviceAssetIds: string[]): Promise<AssetEntity[]> {
return this.repository.find({
async getByDeviceIds(ownerId: string, deviceId: string, deviceAssetIds: string[]): Promise<string[]> {
const assets = await this.repository.find({
select: { deviceAssetId: true },
where: {
deviceAssetId: In(deviceAssetIds),
@@ -165,6 +165,8 @@ export class AssetRepository implements IAssetRepository {
},
withDeleted: true,
});
return assets.map((asset) => asset.deviceAssetId);
}
getByUserId(