diff --git a/apps/publisher-dashboard/src/routes/dashboard/[slug]/+layout.svelte b/apps/publisher-dashboard/src/routes/dashboard/[slug]/+layout.svelte index 91d5a0f..299617f 100644 --- a/apps/publisher-dashboard/src/routes/dashboard/[slug]/+layout.svelte +++ b/apps/publisher-dashboard/src/routes/dashboard/[slug]/+layout.svelte @@ -24,14 +24,24 @@ const userQuery = createQuery(() => ({ // Fetch org members const membersQuery = createQuery(() => ({ queryKey: ["org", slug, "members"], - queryFn: () => api.orgs.members.list({ slug: slug! }), + queryFn: () => { + if (!slug) { + throw new Error("Slug is required"); + } + return api.orgs.members.list({ slug }); + }, enabled: !!slug, })); // Fetch org sites const sitesQuery = createQuery(() => ({ queryKey: ["org", slug, "sites"], - queryFn: () => api.orgs.sites.list({ slug: slug! }), + queryFn: () => { + if (!slug) { + throw new Error("Slug is required"); + } + return api.orgs.sites.list({ slug }); + }, enabled: !!slug, })); diff --git a/apps/publisher-dashboard/svelte.config.js b/apps/publisher-dashboard/svelte.config.js index f9d102c..67cace8 100644 --- a/apps/publisher-dashboard/svelte.config.js +++ b/apps/publisher-dashboard/svelte.config.js @@ -13,6 +13,7 @@ const config = { }, prerender: { handleHttpError: "warn", + handleUnseenRoutes: "ignore", }, }, };