feat: Add Canadian fraction management dialog, implement debounced search for historical fractions and sectors, and enhance USA fraction search with description support.
This commit is contained in:
@@ -41,7 +41,15 @@ export async function getHistoricalFractions(
|
||||
|
||||
if (historicalFraction) params.append('historical_fraction', historicalFraction);
|
||||
|
||||
const response = await api.get<HistoricalFractionList>(`/v1/a76/general_catalogs/fractions/historical-tariff-fractions/?${params.toString()}`);
|
||||
const response = await api.get<{ message?: string, items?: HistoricalFraction[], total?: number }>(`/v1/a76/fractions/historical-tariff-fractions/?${params.toString()}`);
|
||||
|
||||
// Handle potential wrapper response
|
||||
if (response.data && 'items' in response.data) {
|
||||
return response.data as unknown as HistoricalFractionList;
|
||||
}
|
||||
|
||||
if (!response.data) throw new Error('Error fetching historical fractions');
|
||||
return response.data;
|
||||
|
||||
// Fallback
|
||||
return response.data as unknown as HistoricalFractionList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user