we went to mocks - now going to unit-setup.ts - centralized
This commit is contained in:
@@ -20,14 +20,14 @@ export const CorrectionsPage: React.FC = () => {
|
||||
setError(null);
|
||||
try {
|
||||
// Fetch all required data in parallel for efficiency
|
||||
const [correctionsData, masterItemsData, categoriesData] = await Promise.all([
|
||||
const [correctionsResponse, masterItemsResponse, categoriesResponse] = await Promise.all([
|
||||
getSuggestedCorrections(),
|
||||
fetchMasterItems(),
|
||||
fetchCategories()
|
||||
]);
|
||||
setCorrections(correctionsData);
|
||||
setMasterItems(masterItemsData);
|
||||
setCategories(categoriesData);
|
||||
setCorrections(await correctionsResponse.json());
|
||||
setMasterItems(await masterItemsResponse.json());
|
||||
setCategories(await categoriesResponse.json());
|
||||
} catch (err) {
|
||||
logger.error('Failed to fetch corrections', err);
|
||||
const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred while fetching corrections.';
|
||||
|
||||
Reference in New Issue
Block a user