mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 18:54:17 +00:00
fix(memories): scope album link cleanup to its owner
Confirm trip access and the scoped album link inside the transaction before handling related photos. Treat a missing link as a completed removal.
This commit is contained in:
@@ -146,7 +146,7 @@ export class TripPhotosRepository extends TrekRepository<TripPhotos> {
|
||||
.execute();
|
||||
}
|
||||
|
||||
/** UM8 (`UnifiedMemoriesService.removeAlbumLink`'s pre-tx orphan-candidate list) — `SELECT photo_id FROM trip_photos WHERE trip_id = ? AND album_link_id = ?`. */
|
||||
/** UM8 (`UnifiedMemoriesService.removeAlbumLink`, inside its transaction). */
|
||||
async listPhotoIdsForAlbumLink(trip_id: number | string, album_link_id: number | string): Promise<number[]> {
|
||||
const rows = await this.kysely<TripPhotosKyselyDB>()
|
||||
.selectFrom('trip_photos')
|
||||
|
||||
Reference in New Issue
Block a user