Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/app/api/cron/demo-day/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ export async function GET(request: Request) {
);

// Get current week_of (Monday of this week in Helsinki time)
const { data: weekData } = await supabase.rpc("current_week");
const { data: weekData, error: weekError } = await supabase.rpc("current_week");
const weekOf = weekData;

if (weekError) {
return NextResponse.json(
{ error: `Could not determine current week: ${weekError.message}` },
{ status: 500 }
);
}

if (!weekOf) {
return NextResponse.json({ error: "Could not determine current week" }, { status: 500 });
}
Expand Down