Fixed a few bugs

This commit is contained in:
2026-02-08 14:04:11 +01:00
parent 2298edf46e
commit 80336104bc
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -48,15 +48,15 @@ export async function POST(req: NextRequest) {
if (!session) if (!session)
return NextResponse.json({ error: "Invalid session" }, { status: 401 }); return NextResponse.json({ error: "Invalid session" }, { status: 401 });
const run = await Core.getLiveRun(runId); const liveRun = await Core.getLiveRun(runId);
if (!run) if (!liveRun)
return NextResponse.json( return NextResponse.json(
{ error: "Run is not live or does not exist" }, { error: "Run is not live or does not exist" },
{ status: 401 }, { status: 401 },
); );
await Core.submitRun(supabase, run, session[0].id); const run = await Core.submitRun(supabase, liveRun, session[0].id);
return NextResponse.json({ ok: true, runId }); return NextResponse.json({ ok: true, run });
} }
+1 -1
View File
@@ -22,7 +22,7 @@ export async function getLiveRunMoves(
} }
export async function addRun(run: LiveRun) { export async function addRun(run: LiveRun) {
if (!liveRuns.find((r) => r.id === run.id || r.username === run.username)) if (liveRuns.find((r) => r.id === run.id || r.username === run.username))
throw "Duplicate run"; throw "Duplicate run";
liveRuns.push(run); liveRuns.push(run);