mirror of
https://github.com/immich-app/immich.git
synced 2025-01-21 00:52:43 -05: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
2 changed files with 8 additions and 2 deletions
|
@ -177,14 +177,15 @@ export class AlbumRepository implements IAlbumRepository {
|
|||
});
|
||||
}
|
||||
|
||||
// @GenerateSql({ params: [DummyValue.UUID] })
|
||||
@GenerateSql({ params: [DummyValue.UUID] })
|
||||
async removeAsset(assetId: string): Promise<void> {
|
||||
// Using dataSource, because there is no direct access to albums_assets_assets.
|
||||
await this.dataSource
|
||||
.createQueryBuilder()
|
||||
.delete()
|
||||
.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] }] })
|
||||
|
|
|
@ -508,6 +508,11 @@ FROM
|
|||
WHERE
|
||||
"AlbumEntity"."deletedAt" IS NULL
|
||||
|
||||
-- AlbumRepository.removeAsset
|
||||
DELETE FROM "albums_assets_assets"
|
||||
WHERE
|
||||
"albums_assets_assets"."assetsId" = $1
|
||||
|
||||
-- AlbumRepository.removeAssets
|
||||
DELETE FROM "albums_assets_assets"
|
||||
WHERE
|
||||
|
|
Loading…
Add table
Reference in a new issue