From 20475861a53494e45658d5772e08c9b874b934d1 Mon Sep 17 00:00:00 2001 From: RevIQ Date: Fri, 9 Jan 2026 18:23:38 +0800 Subject: [PATCH] Fix linter warnings and build issues - Replace non-null assertions with runtime checks in org layout queries - Add handleUnseenRoutes: "ignore" for dynamic dashboard routes Co-Authored-By: Claude Opus 4.5 --- .../src/routes/dashboard/[slug]/+layout.svelte | 14 ++++++++++++-- apps/publisher-dashboard/svelte.config.js | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) 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", }, }, };