Skip to content

Commit

Permalink
Merge pull request #1268 from andrew-bierman/fix/trip-card
Browse files Browse the repository at this point in the history
add trip details to feed query
  • Loading branch information
taronaleksanian authored Sep 26, 2024
2 parents c7cde00 + 507ca70 commit f526655
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/src/modules/feed/model/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit f526655

Please sign in to comment.