Index: components/ProductSplitValidator/ProductSplitValidator.container.ts =================================================================== diff -u -r35493d3819977256e2770770788288401f2aba1c -rce6c5235046ee7feeef434bab9fc1e935e1d48a2 --- components/ProductSplitValidator/ProductSplitValidator.container.ts (.../ProductSplitValidator.container.ts) (revision 35493d3819977256e2770770788288401f2aba1c) +++ components/ProductSplitValidator/ProductSplitValidator.container.ts (.../ProductSplitValidator.container.ts) (revision ce6c5235046ee7feeef434bab9fc1e935e1d48a2) @@ -21,7 +21,15 @@ displayError: () => dispatch(productSplitValidator.enterErrorState()), fetchPartNumbers: () => service.product.part(+props.productId) .then(map(prop("partNumber"))), - fetchValidationData: () => service.product.splitValidationData(+props.productId), + fetchValidationData: () => service.product.splitValidationData(+props.productId) + .then((response: any) => { + // Extract results array from the response + if (response && typeof response === 'object' && Array.isArray(response.results)) { + return response.results as ISplitValidationRow[]; + } + // If response is already an array or has unexpected format, return it as is + return Array.isArray(response) ? response : [] as ISplitValidationRow[]; + }), setBulkParts: (partNumbers:string[]) => dispatch(bulkAttributeAssignmentParts.set(partNumbers)), setData: (data:ISplitValidationRow[], partNumbers:string[]) => dispatch(productSplitValidator.leaveLoadingState(data, partNumbers)), startLoading: () => dispatch(productSplitValidator.enterLoadingState()), @@ -42,12 +50,14 @@ runValidation: async () => { dispatch.startLoading(); try { + console.log('Starting validation for product ID:', props.productId); const [data, partNumbers] = await Promise.all([dispatch.fetchValidationData(), dispatch.fetchPartNumbers()]); const localeData = getLocaleRelevantValidation(data); dispatch.setData(localeData, partNumbers) } catch (error) { + console.error('Error in split validation:', error); dispatch.displayError(); } }