From 167b22d3ec834e3d51ab57681830adb3bdf5d528 Mon Sep 17 00:00:00 2001 From: Urvish Date: Wed, 2 Dec 2026 16:01:36 +0530 Subject: [PATCH] feat(plans): enable Included Modules checklist for PATTERN_CORE and NUTRITION_CORE --- src/App.tsx | 10 +++++++--- src/components/plans/EditPriceModal.tsx | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 9b32a33..247a32a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -630,6 +630,10 @@ export default function App() { } setEditPriceSaving(true); try { + const isEditableBundle = + selectedEditPricePlan.plan_type === 'bundle' || + selectedEditPricePlan.base_code === 'PATTERN_CORE' || + selectedEditPricePlan.base_code === 'NUTRITION_CORE'; await axios.put( `${API_BASE}/api/admin/plans/${selectedEditPricePlan.base_code}/pricing`, { @@ -641,12 +645,12 @@ export default function App() { badge_text: editPlanBadge.trim() || undefined, heading: editPlanHeading.trim() || undefined, subtitle: editPlanSubtitle.trim() || undefined, - module_ids: selectedEditPricePlan.plan_type === 'bundle' ? editPlanModuleIds : undefined, + module_ids: isEditableBundle ? editPlanModuleIds : undefined, }, { headers: { Authorization: `Bearer ${userToken}` } } ); const updatedBundleModules = - selectedEditPricePlan.plan_type === 'bundle' + isEditableBundle ? adminModulesList.filter((m) => editPlanModuleIds.includes(m.id)) : undefined; setAdminPlansList((prev) => @@ -664,7 +668,7 @@ export default function App() { price_eur: eurVal, pricing_status: inrVal > 0 || usdVal > 0 || eurVal > 0 ? 'configured' : p.pricing_status, - ...(selectedEditPricePlan.plan_type === 'bundle' + ...(isEditableBundle ? { module_ids: editPlanModuleIds, modules: updatedBundleModules } : {}), } diff --git a/src/components/plans/EditPriceModal.tsx b/src/components/plans/EditPriceModal.tsx index c99e6bb..1d48edd 100644 --- a/src/components/plans/EditPriceModal.tsx +++ b/src/components/plans/EditPriceModal.tsx @@ -178,7 +178,7 @@ export const EditPriceModal: React.FC = ({ - {plan.plan_type === 'bundle' && allModules.length > 0 && onToggleModule && ( + {(plan.plan_type === 'bundle' || plan.base_code === 'PATTERN_CORE' || plan.base_code === 'NUTRITION_CORE') && allModules.length > 0 && onToggleModule && (