mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Add basic forms and routes
This commit is contained in:
@@ -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
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user