debug: add error logging to getClientWithProjectsByToken
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -133,6 +133,7 @@ export interface ClientProjectSummary {
|
|||||||
export async function getClientWithProjectsByToken(
|
export async function getClientWithProjectsByToken(
|
||||||
tokenOrSlug: string
|
tokenOrSlug: string
|
||||||
): Promise<ClientProjectSummary | null> {
|
): Promise<ClientProjectSummary | null> {
|
||||||
|
try {
|
||||||
// Try slug first
|
// Try slug first
|
||||||
let clientRows = await db
|
let clientRows = await db
|
||||||
.select({
|
.select({
|
||||||
@@ -173,6 +174,10 @@ export async function getClientWithProjectsByToken(
|
|||||||
const activeProjects = projectRows.filter((p) => !p.archived);
|
const activeProjects = projectRows.filter((p) => !p.archived);
|
||||||
|
|
||||||
return { client, projects: activeProjects };
|
return { client, projects: activeProjects };
|
||||||
|
} catch (err) {
|
||||||
|
console.error("[client-view] getClientWithProjectsByToken error:", err);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user