feat(customers): add initial admin bootstrap and csv import

This commit is contained in:
DS | Schubert 2026-07-03 09:14:56 +02:00
parent c816e9869d
commit ecab0fe6b6
27 changed files with 1197 additions and 34 deletions

View file

@ -27,6 +27,8 @@ export async function proxyHermesRequest(
}
let hermesResponse: Response;
const isMultipart = request.headers.get("content-type")?.includes("multipart/form-data") ?? false;
const hasBody = request.method !== "GET" && request.method !== "DELETE";
try {
hermesResponse = await fetch(`${hermesUrl}${path}`, {
@ -34,11 +36,13 @@ export async function proxyHermesRequest(
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json",
"Content-Type": "application/json",
...(!isMultipart ? { "Content-Type": "application/json" } : {}),
},
body: request.method === "GET" || request.method === "DELETE"
body: !hasBody
? undefined
: await request.text(),
: isMultipart
? await request.formData()
: await request.text(),
cache: "no-store",
});
} catch {