The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update route.ts
Kiran K80e5d6ef27c0
diff --git a/apps/web/app/api/programs/[programId]/earnings/route.ts b/apps/web/app/api/programs/[programId]/earnings/route.tsindex 5d1689f7d7..879cc41d34 100644--- a/apps/web/app/api/programs/[programId]/earnings/route.ts+++ b/apps/web/app/api/programs/[programId]/earnings/route.ts@@ -8,11 +8,9 @@ import { DateTime } from "luxon";import { NextResponse } from "next/server";const programAnalyticsQuerySchema = analyticsQuerySchema.pick({- event: true,start: true,end: true,interval: true,- groupBy: true,timezone: true,});@@ -54,7 +52,6 @@ export const GET = withWorkspace(GROUP BY startORDER BY start ASC;`;- const timeseries: Earnings[] = [];let currentDate = startFunction(DateTime.fromJSDate(startDate).setZone(timezone || "UTC"),);@@ -68,6 +65,8 @@ export const GET = withWorkspace(]),);+ const timeseries: Earnings[] = [];+while (currentDate < endDate) {const periodKey = currentDate.toFormat(formatString);