diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f86e175..bd16d45 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,5 @@ allowBuilds: - esbuild: set this to true or false + esbuild: true sharp: true ignoredBuiltDependencies: - sharp diff --git a/src/app/FamilyProvider.tsx b/src/app/FamilyProvider.tsx index 9f33d54..bf56eb6 100644 --- a/src/app/FamilyProvider.tsx +++ b/src/app/FamilyProvider.tsx @@ -70,6 +70,13 @@ export function FamilyProvider({ children: providerChildren }: { children: React const res = await fetch(`/api/children?familyId=${familyId}`); const data = await res.json(); + // Handle API error + if (!res.ok || data.error) { + console.error("Failed to fetch children:", data.error); + setLoading(false); + return; + } + if (data.children?.length > 0) { const childList = data.children.map((c: any) => ({ id: c.id,