console removed
This commit is contained in:
parent
d2d870de1c
commit
e00a597b83
@ -529,22 +529,11 @@ if (!establishment) {
|
||||
const formattedProducts = products.map(product => {
|
||||
// Find the existing product in the current submission's products
|
||||
const selectedProduct = productOptions.find(p => p.value === product.product);
|
||||
console.log('Product matching debug:', {
|
||||
product,
|
||||
selectedProduct,
|
||||
productOptions,
|
||||
currentSubmissionProducts: currentSubmission.products
|
||||
});
|
||||
const existingProduct = currentSubmission.products?.find(p =>
|
||||
p.product_id == product.product_id || // Loose equality to handle string/number mismatch
|
||||
p.product?.id == product.product_id // Also check nested product.id
|
||||
);
|
||||
console.log('Product matching debug:', {
|
||||
productId: product.product_id,
|
||||
productIdType: typeof product.product_id,
|
||||
existingProduct,
|
||||
currentSubmissionProducts: currentSubmission.products
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
// Use the existing product ID if found, otherwise use 0 for new products
|
||||
|
||||
Loading…
Reference in New Issue
Block a user