Skip to content

Commit d2f2f74

Browse files
committed
fix: Unable to serialize bigint on statistics
1 parent de2270d commit d2f2f74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/api/src/statistics/statistics.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class StatisticsService {
3232
: Prisma.sql`GROUP BY DATE_TRUNC('DAY', d.created_at)`
3333

3434
return this.prisma.$queryRaw`
35-
SELECT SUM(d.amount)::BIGINT as sum, COUNT(d.id)::INTEGER as count, ${date}
35+
SELECT COALESCE(SUM(d.amount), 0)::NUMERIC as sum, COUNT(d.id)::INTEGER as count, ${date}
3636
FROM api.donations d
3737
INNER JOIN api.payments p ON p.id = d.payment_id
3838
WHERE p.status::text = 'succeeded'

0 commit comments

Comments
 (0)