✨ Rework Shop pages and switch to page endpoints
- Create ShopHeader component to reuse on pages - Use page endpoints to query data from API and Swell - Remove use of `stuff`
This commit is contained in:
@@ -41,10 +41,10 @@
|
||||
|
||||
|
||||
<script context="module" lang="ts">
|
||||
import type { LoadEvent, LoadOutput } from '@sveltejs/kit'
|
||||
import { fetchAPI } from '$utils/api'
|
||||
|
||||
/** @type {import('@sveltejs/kit').Load} */
|
||||
export async function load ({ url, params, fetch, session, stuff }) {
|
||||
export async function load ({ fetch }: LoadEvent): Promise<LoadOutput> {
|
||||
// Get content from API
|
||||
const res = await fetchAPI(`
|
||||
query {
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
`)
|
||||
|
||||
const { data: { shop, location, posters } } = res
|
||||
const { data: { shop, location, posters }} = res
|
||||
|
||||
|
||||
/**
|
||||
@@ -123,11 +123,6 @@
|
||||
posters,
|
||||
shopProducts,
|
||||
},
|
||||
stuff: {
|
||||
shop,
|
||||
posters,
|
||||
shopProducts,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user