From 0d4ae03789513d52961e6ebf1e99412403581057 Mon Sep 17 00:00:00 2001 From: Malini Date: Fri, 20 Feb 2026 12:44:10 +0530 Subject: [PATCH] fix product issue --- .../configuration/EditCompanyProfile.jsx | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx b/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx index 32b1439..621a551 100644 --- a/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx +++ b/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx @@ -330,25 +330,8 @@ const EditCompanyProfile = () => { ); if (newChecked.has(productValue)) { - // Unchecking: move product from selected to available + // Unchecking: only remove from checked, don't add to available products newChecked.delete(productValue); - - if (product) { - // Add product back to available products - setAvailableProducts(prev => { - const alreadyExists = prev.some(p => - (p.value && p.value === product.value) || - (p.id && p.id === product.id) || - (p.product_id && p.product_id === product.product_id) - ); - - if (!alreadyExists) { - console.log('ADDING TO AVAILABLE - new length will be:', prev.length + 1); - return [...prev, product]; - } - return prev; - }); - } } else { // Re-checking: add the product back to checked newChecked.add(productValue); @@ -1134,7 +1117,7 @@ const EditCompanyProfile = () => { className="w-full px-3 py-2 border border-[#D1D5DB] rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#92722A] focus:border-transparent" /> { className="p-3 hover:bg-[#F9FAFB] flex justify-between items-center" >
+ {!isNewlyAdded && ( + )} {product.action_done_by === "admin_users" ? (