chore: perauset customer project

This commit is contained in:
e2e
2026-07-11 08:35:17 +02:00
commit 37eea09bf0
293 changed files with 28412 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
function buildHeaders(cookies?: string): Record<string, string> {
const headers: Record<string, string> = {
'Content-Type': 'application/json',
Accept: 'application/json',
}
if (cookies) {
headers['Cookie'] = cookies
}
return headers
}
export async function apiGet(
url: string,
path: string,
cookies?: string
): Promise<Response> {
return fetch(`${url}${path}`, {
method: 'GET',
headers: buildHeaders(cookies),
})
}
export async function apiPost(
url: string,
path: string,
body: any,
cookies?: string
): Promise<Response> {
return fetch(`${url}${path}`, {
method: 'POST',
headers: buildHeaders(cookies),
body: JSON.stringify(body),
})
}
export async function apiPut(
url: string,
path: string,
body: any,
cookies?: string
): Promise<Response> {
return fetch(`${url}${path}`, {
method: 'PUT',
headers: buildHeaders(cookies),
body: JSON.stringify(body),
})
}
export async function apiDelete(
url: string,
path: string,
cookies?: string
): Promise<Response> {
return fetch(`${url}${path}`, {
method: 'DELETE',
headers: buildHeaders(cookies),
})
}