From 507ca700c63f5315505ea603dcb0e20ca5110293 Mon Sep 17 00:00:00 2001 From: Taron Date: Thu, 26 Sep 2024 20:51:20 +0400 Subject: [PATCH] add trip details to feed query --- server/src/modules/feed/model/feed.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/modules/feed/model/feed.ts b/server/src/modules/feed/model/feed.ts index 54615d061..05ca65944 100644 --- a/server/src/modules/feed/model/feed.ts +++ b/server/src/modules/feed/model/feed.ts @@ -40,6 +40,9 @@ export class Feed { quantity: sql`COALESCE(SUM(DISTINCT ${item.quantity}), 0)`, userFavorites: sql`GROUP_CONCAT(DISTINCT ${userFavoritePacks.userId})`, total_weight: sql`COALESCE(SUM(DISTINCT ${item.weight} * ${item.quantity}), 0) as total_weight`, + activity: literal(null), + start_date: literal(null), + end_date: literal(null), }) .from(pack) .leftJoin(userFavoritePacks, eq(pack.id, userFavoritePacks.packId)) @@ -69,6 +72,9 @@ export class Feed { quantity: literal(null), userFavorites: literal('[]'), total_weight: literal('0'), + activity: trip.activity, + start_date: trip.start_date, + end_date: trip.end_date, }) .from(trip);