diff --git a/src/lib/client-view.ts b/src/lib/client-view.ts index b6c49ea..66fc3f7 100644 --- a/src/lib/client-view.ts +++ b/src/lib/client-view.ts @@ -133,6 +133,7 @@ export interface ClientProjectSummary { export async function getClientWithProjectsByToken( tokenOrSlug: string ): Promise { + try { // Try slug first let clientRows = await db .select({ @@ -173,6 +174,10 @@ export async function getClientWithProjectsByToken( const activeProjects = projectRows.filter((p) => !p.archived); return { client, projects: activeProjects }; + } catch (err) { + console.error("[client-view] getClientWithProjectsByToken error:", err); + return null; + } } /**