bg fixed
This commit is contained in:
parent
5135c4dd48
commit
09bfad5cd0
@ -1267,7 +1267,10 @@ useEffect(() => {
|
||||
// Ensure we're working with an array and handle the response structure
|
||||
const productsList = Array.isArray(apiResponse) ? apiResponse : (apiResponse?.data || []);
|
||||
|
||||
const formattedProducts = productsList.map(product => {
|
||||
// Filter only active products where is_active === 1
|
||||
const activeProductsList = productsList.filter(product => product.is_active === 1);
|
||||
|
||||
const formattedProducts = activeProductsList.map(product => {
|
||||
// Handle nested properties with dot notation
|
||||
const productName = product['product.product_name'] || product.product_name || product.product?.product_name || '';
|
||||
const hsCode = product['product.hs_code'] || product.hs_code || product.product?.hs_code || '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user