mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 05:34:32 -04:00
fix(server): Execute query in AlbumRepository.removeAsset method (#6216)
The current `removeAsset` implementation just builds the query but does not execute it. That also seems to be the reason the `@GenerateSql` decorator was commented out.
This commit is contained in:
parent
a233e176e5
commit
8921278447
@ -177,14 +177,15 @@ export class AlbumRepository implements IAlbumRepository {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// @GenerateSql({ params: [DummyValue.UUID] })
|
@GenerateSql({ params: [DummyValue.UUID] })
|
||||||
async removeAsset(assetId: string): Promise<void> {
|
async removeAsset(assetId: string): Promise<void> {
|
||||||
// Using dataSource, because there is no direct access to albums_assets_assets.
|
// Using dataSource, because there is no direct access to albums_assets_assets.
|
||||||
await this.dataSource
|
await this.dataSource
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.delete()
|
.delete()
|
||||||
.from('albums_assets_assets')
|
.from('albums_assets_assets')
|
||||||
.where('"albums_assets_assets"."assetsId" = :assetId', { assetId });
|
.where('"albums_assets_assets"."assetsId" = :assetId', { assetId })
|
||||||
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@GenerateSql({ params: [{ albumId: DummyValue.UUID, assetIds: [DummyValue.UUID] }] })
|
@GenerateSql({ params: [{ albumId: DummyValue.UUID, assetIds: [DummyValue.UUID] }] })
|
||||||
|
@ -508,6 +508,11 @@ FROM
|
|||||||
WHERE
|
WHERE
|
||||||
"AlbumEntity"."deletedAt" IS NULL
|
"AlbumEntity"."deletedAt" IS NULL
|
||||||
|
|
||||||
|
-- AlbumRepository.removeAsset
|
||||||
|
DELETE FROM "albums_assets_assets"
|
||||||
|
WHERE
|
||||||
|
"albums_assets_assets"."assetsId" = $1
|
||||||
|
|
||||||
-- AlbumRepository.removeAssets
|
-- AlbumRepository.removeAssets
|
||||||
DELETE FROM "albums_assets_assets"
|
DELETE FROM "albums_assets_assets"
|
||||||
WHERE
|
WHERE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user