High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): cannot delete an asset if presented in album (#2223)
Alexdb628cec11d4
diff --git a/server/libs/infra/src/entities/album.entity.ts b/server/libs/infra/src/entities/album.entity.tsindex a785a939d3..6dcebf8a17 100644--- a/server/libs/infra/src/entities/album.entity.ts+++ b/server/libs/infra/src/entities/album.entity.ts@@ -43,7 +43,7 @@ export class AlbumEntity {@JoinTable()sharedUsers!: UserEntity[];- @ManyToMany(() => AssetEntity)+ @ManyToMany(() => AssetEntity, (asset) => asset.albums)@JoinTable()assets!: AssetEntity[];diff --git a/server/libs/infra/src/entities/asset.entity.ts b/server/libs/infra/src/entities/asset.entity.tsindex 6c003484e5..ba83e62542 100644--- a/server/libs/infra/src/entities/asset.entity.ts+++ b/server/libs/infra/src/entities/asset.entity.ts@@ -101,7 +101,7 @@ export class AssetEntity {@JoinTable({ name: 'shared_link__asset' })sharedLinks!: SharedLinkEntity[];- @ManyToMany(() => AlbumEntity, (album) => album.assets)+ @ManyToMany(() => AlbumEntity, (album) => album.assets, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })albums?: AlbumEntity[];}