import { error } from '@sveltejs/kit'; /** @type {import('./$types').PageLoad} */ export async function load({ params, fetch }) { const { id } = params; // const request = await fetch(`/api/community/${card?.id}?${new URLSearchParams(form)}`); // const { gallery, next, previous } = await request.json(); const model_request = await fetch(`/api/community/${id}`, { method: "GET", headers: { "Content-Type": "application/json" } }) const data = await model_request?.clone().json().catch(() => null); const { gallery, next, previous } = data; if (!gallery) { return error(404, 'Not found'); } return { gallery, next, previous } }