Bound request bodies and artifact uploads (Refs #94)
CI / checks (push) Successful in 4m34s

This commit is contained in:
2026-10-09 16:52:37 -04:00
parent 8fcb8312a3
commit 9eb3aa84c3
44 changed files with 603 additions and 79 deletions
+4 -2
View File
@@ -1,4 +1,5 @@
import { json } from '@sveltejs/kit';
import { jsonBody } from '$lib/server/request-body.js';
import { isHttpError, json } from '@sveltejs/kit';
import {
retentionPreview,
retentionControls,
@@ -22,9 +23,10 @@ export function GET() {
}
export async function POST({ request }: { request: Request }) {
try {
setRetentionControl(await request.json());
setRetentionControl(await jsonBody(request));
return json({ ok: true });
} catch (error) {
if (isHttpError(error, 413)) throw error;
return json({ error: (error as Error).message }, { status: 400 });
}
}