Fix Shop fetching on server side?

This commit is contained in:
2022-09-18 12:52:48 +02:00
parent e870816ddc
commit 2393d28597
2 changed files with 4 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
import { error } from '@sveltejs/kit'
import type { PageServerLoad } from './$types'
import { fetchAPI } from '$utils/api'
import { getProducts } from '$utils/functions/shop'
import { initSwell, getProducts } from '$utils/functions/shop'
export const load: PageServerLoad = async () => {
try {
@@ -55,6 +55,7 @@ export const load: PageServerLoad = async () => {
/**
* Get products data from Swell
*/
initSwell()
const shopProducts = await getProducts('posters')
if (shopProducts) {