Fix filters API response structure
Backend returns filters directly at top level, not wrapped in 'filters' property. Update FiltersResponse type and page components to match actual API response. Fixes empty dropdowns for school types and local authorities. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,7 +48,7 @@ export default async function HomePage({ searchParams }: HomePageProps) {
|
||||
return (
|
||||
<HomeView
|
||||
initialSchools={schoolsData}
|
||||
filters={filtersData?.filters || { local_authorities: [], school_types: [], years: [] }}
|
||||
filters={filtersData || { local_authorities: [], school_types: [], years: [] }}
|
||||
/>
|
||||
);
|
||||
} catch (error) {
|
||||
|
||||
@@ -49,7 +49,7 @@ export default async function RankingsPage({ searchParams }: RankingsPageProps)
|
||||
return (
|
||||
<RankingsView
|
||||
rankings={rankingsResponse?.rankings || []}
|
||||
filters={filtersResponse?.filters || { local_authorities: [], school_types: [], years: [] }}
|
||||
filters={filtersResponse || { local_authorities: [], school_types: [], years: [] }}
|
||||
metrics={metricsArray}
|
||||
selectedMetric={metric}
|
||||
selectedArea={local_authority}
|
||||
|
||||
Reference in New Issue
Block a user