Compare commits

..

No commits in common. "56cb400c19b0348a595fb71aa0a2a67ff62cb18f" and "2cb277ee9883ec0317991e14d2af7533f448df1e" have entirely different histories.

1 changed files with 0 additions and 25 deletions

View File

@ -459,30 +459,6 @@ export default function App() {
{ is_active: newActive, status: newStatus },
{ headers: { Authorization: `Bearer ${userToken}` } }
);
const linkedPlans = adminPlansList.filter((p) =>
p.base_code?.toLowerCase() === mod.code?.toLowerCase() ||
p.module_ids?.includes(mod.id) ||
p.modules?.some((m: any) => m.id === mod.id || m.slug === mod.slug)
);
for (const plan of linkedPlans) {
if (plan.is_active !== newActive) {
try {
await axios.patch(
`${API_BASE}/api/admin/plans/${plan.base_code}/status`,
{ is_active: newActive },
{ headers: { Authorization: `Bearer ${userToken}` } }
);
setAdminPlansList((prev) =>
prev.map((p) => (p.base_code === plan.base_code ? { ...p, is_active: newActive } : p))
);
} catch (planErr) {
console.error('Failed to sync linked plan status:', planErr);
}
}
}
setAdminLogs((prev) => [`[Catalog] ${mod.name} is now ${newActive ? 'Active' : 'Inactive'}`, ...prev]);
} catch (err: any) {
setAdminModulesList((prev) =>
@ -492,7 +468,6 @@ export default function App() {
}
};
const handleOpenEditModule = (mod: any) => {
setSelectedEditModule(mod);
setEditModuleName(mod.name || '');