Fix metrics API response structure
Backend returns metrics as an array, not an object. - Update MetricsResponse type to use MetricDefinition[] instead of Record - Remove Object.values() conversion in compare and rankings pages - Fix useMetrics hook to handle array instead of object - Fix getMetric to use array.find() instead of object indexing Fixes empty metric dropdown on compare page. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -194,8 +194,9 @@ export interface MetricDefinition {
|
||||
hasNationalAverage?: boolean;
|
||||
}
|
||||
|
||||
// Backend returns metrics as an array, not an object
|
||||
export interface MetricsResponse {
|
||||
metrics: Record<string, MetricDefinition>;
|
||||
metrics: MetricDefinition[];
|
||||
}
|
||||
|
||||
export interface DataInfoResponse {
|
||||
|
||||
Reference in New Issue
Block a user