Compare commits
1 Commits
main
...
fix/plans-
| Author | SHA1 | Date |
|---|---|---|
|
|
cebc0981d0 |
16
src/App.tsx
16
src/App.tsx
|
|
@ -763,13 +763,17 @@ export default function App() {
|
||||||
{ headers: { Authorization: `Bearer ${userToken}` } }
|
{ headers: { Authorization: `Bearer ${userToken}` } }
|
||||||
);
|
);
|
||||||
|
|
||||||
if (res.data?.plan) {
|
const plansRes = await axios.get(`${API_BASE}/api/admin/plans`, {
|
||||||
setAdminPlansList((prev) => [res.data.plan, ...prev]);
|
headers: { Authorization: `Bearer ${userToken}` },
|
||||||
setAdminLogs((prev) => [
|
});
|
||||||
`[Plans] Created custom plan '${res.data.plan.name}' (${res.data.plan.base_code})`,
|
if (Array.isArray(plansRes.data)) {
|
||||||
...prev,
|
setAdminPlansList(plansRes.data);
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
const createdCode = res.data?.base_code || createPlanCode.trim().toUpperCase();
|
||||||
|
setAdminLogs((prev) => [
|
||||||
|
`[Plans] Created custom plan '${createPlanName.trim()}' (${createdCode})`,
|
||||||
|
...prev,
|
||||||
|
]);
|
||||||
setShowCreatePlanModal(false);
|
setShowCreatePlanModal(false);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
setCreatePlanError(extractErrorMessage(err, 'Failed to create custom plan.'));
|
setCreatePlanError(extractErrorMessage(err, 'Failed to create custom plan.'));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue