Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update route.ts

Kiran Kef5ac5f8683f
diff --git a/apps/web/app/api/programs/[programId]/revenue/route.ts b/apps/web/app/api/programs/[programId]/revenue/route.ts
index a1f10672f1..8644dec75d 100644
--- a/apps/web/app/api/programs/[programId]/revenue/route.ts
+++ b/apps/web/app/api/programs/[programId]/revenue/route.ts
@@ -55,9 +55,9 @@ export const GET = withWorkspace(
SUM(CASE WHEN type = 'sale' THEN amount ELSE 0 END) AS saleAmount
FROM Commission
WHERE
- createdAt >= ${startDate}
+ programId = ${program.id}
+ AND createdAt >= ${startDate}
AND createdAt < ${endDate}
- AND programId = ${program.id}
GROUP BY start
ORDER BY start ASC;
`;