Add basic forms and routes

This commit is contained in:
Thilo Hohlt
2024-08-01 18:09:35 +02:00
parent d21e00a0c3
commit b0666f4a8c
20 changed files with 762 additions and 342 deletions

View File

@@ -1,5 +1,14 @@
export const load = async ({ params, fetch, cookies }) => {
const websiteData = await fetch(`http://localhost:3000/content?id=eq.${params.websiteId}`, {
const websiteData = await fetch(`http://localhost:3000/website?id=eq.${params.websiteId}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${cookies.get("session_token")}`,
Accept: "application/vnd.pgrst.object+json"
}
});
const homeData = await fetch(`http://localhost:3000/home?website_id=eq.${params.websiteId}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
@@ -9,8 +18,10 @@ export const load = async ({ params, fetch, cookies }) => {
});
const website = await websiteData.json();
const home = await homeData.json();
return {
website
website,
home
};
};