H5: admin-scherm voor de hero (formulier, slides, upload, focus-editor met voorbeeld, TypeScript-tweeling van FocusMath)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 16:07:49 +01:00
co-authored by Claude Sonnet 5.5
parent 4369c905cd
commit 5559d459c3
21 changed files with 1635 additions and 15 deletions
+4 -2
View File
@@ -129,7 +129,9 @@ export class ApiClient {
const { body, skipAuthRefresh: _skip, headers, ...rest } = options;
const finalHeaders = new Headers(headers);
if (body !== undefined && body !== null) {
// A FormData body (file upload) is sent as is: the browser sets the multipart content type and boundary.
const isForm = typeof FormData !== 'undefined' && body instanceof FormData;
if (body !== undefined && body !== null && !isForm) {
finalHeaders.set('Content-Type', 'application/json');
}
if (this.accessToken !== null) {
@@ -143,7 +145,7 @@ export class ApiClient {
credentials: 'include',
// A list read after a change must come from the server, never from an intermediate cache.
...(rest.method === 'GET' ? { cache: 'no-store' as const } : {}),
body: body !== undefined && body !== null ? JSON.stringify(body) : undefined,
body: body !== undefined && body !== null ? (isForm ? (body as FormData) : JSON.stringify(body)) : undefined,
});
} catch (cause) {
throw new NetworkError(cause instanceof Error ? cause.message : undefined);