We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de2270d commit 8a493aeCopy full SHA for 8a493ae
apps/api/src/statistics/statistics.service.ts
@@ -32,7 +32,7 @@ export class StatisticsService {
32
: Prisma.sql`GROUP BY DATE_TRUNC('DAY', d.created_at)`
33
34
return this.prisma.$queryRaw`
35
- SELECT SUM(d.amount)::BIGINT as sum, COUNT(d.id)::INTEGER as count, ${date}
+ SELECT COALESCE(SUM(d.amount), 0)::NUMERIC as sum, COUNT(d.id)::INTEGER as count, ${date}
36
FROM api.donations d
37
INNER JOIN api.payments p ON p.id = d.payment_id
38
WHERE p.status::text = 'succeeded'
0 commit comments