Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix for deleting albums

Marek Maslowskif225f45f501c
diff --git a/server/src/services/memories/unifiedService.ts b/server/src/services/memories/unifiedService.ts
index 72fbcb837..ff837383c 100644
--- a/server/src/services/memories/unifiedService.ts
+++ b/server/src/services/memories/unifiedService.ts
@@ -268,12 +268,10 @@ export function removeAlbumLink(tripId: string, linkId: string, userId: number):
}
try {
- db.transaction(() => {
- db.prepare('DELETE FROM trip_photos WHERE trip_id = ? AND album_link_id = ?')
- .run(tripId, linkId);
- db.prepare('DELETE FROM trip_album_links WHERE id = ? AND trip_id = ? AND user_id = ?')
- .run(linkId, tripId, userId);
- });
+ db.prepare('DELETE FROM trip_photos WHERE trip_id = ? AND album_link_id = ?')
+ .run(tripId, linkId);
+ db.prepare('DELETE FROM trip_album_links WHERE id = ? AND trip_id = ? AND user_id = ?')
+ .run(linkId, tripId, userId);
return success(true);
} catch (error) {
return mapDbError(error, 'Failed to remove album link');