work on porting over contact form from old site, also added initial db support

to use later
This commit is contained in:
badblocks 2026-01-06 08:07:19 -08:00
parent 8d989ef36f
commit f641dac69b
No known key found for this signature in database
12 changed files with 232 additions and 32 deletions

View file

@ -0,0 +1,46 @@
const httpFetchClient = {
get: async (url: string, headers: Record<string, string>) => {
const response = await fetch(url, {
method: "GET",
headers,
});
return response.json();
},
post: async (url: string, body: JSON, headers: Record<string, string>) => {
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
});
return response.json();
},
put: async (url: string, body: JSON, headers: Record<string, string>) => {
const response = await fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
});
return response.json();
},
patch: async (url: string, body: JSON, headers: Record<string, string>) => {
const response = await fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
});
return response.json();
},
delete: async (url: string, headers: Record<string, string>) => {
const response = await fetch(url, {
method: "DELETE",
headers,
});
return response.json();
},
};
export default httpFetchClient;