mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
testing 127.0.0.1 issue
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -100,20 +100,10 @@ export default function PaymentPolicy() {
|
||||
},
|
||||
promo_rules: promoRules,
|
||||
});
|
||||
toast("Payment policy saved.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
});
|
||||
toast("Payment policy saved.");
|
||||
navigate("/admin/tiers/plans");
|
||||
} catch (err) {
|
||||
toast(err?.response?.data?.message ?? "Could not save payment policy.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
});
|
||||
toast(err?.response?.data?.message ?? "Could not save payment policy.");
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
@@ -123,25 +113,10 @@ export default function PaymentPolicy() {
|
||||
|
||||
const handleAddPromo = () => {
|
||||
const code = addForm.code.trim().toUpperCase();
|
||||
if (!code) { toast("Code is required.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
}); return; }
|
||||
if (!addForm.value || Number(addForm.value) <= 0) { toast("Value must be greater than 0.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
}); return; }
|
||||
if (!code) { toast("Code is required."); return; }
|
||||
if (!addForm.value || Number(addForm.value) <= 0) { toast("Value must be greater than 0."); return; }
|
||||
if (promoRules.some((r) => r.code.toUpperCase() === code)) {
|
||||
toast("A rule with this code already exists.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
}); return;
|
||||
toast("A rule with this code already exists."); return;
|
||||
}
|
||||
|
||||
const rule = {
|
||||
|
||||
@@ -220,19 +220,9 @@ function PaymentPolicyTab({ planId, plan }) {
|
||||
},
|
||||
promo_rules: promoRules,
|
||||
});
|
||||
toast("Payment policy saved.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
});
|
||||
toast("Payment policy saved.");
|
||||
} catch (err) {
|
||||
toast(err?.response?.data?.message ?? "Could not save payment policy.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
});
|
||||
toast(err?.response?.data?.message ?? "Could not save payment policy.");
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
@@ -240,24 +230,9 @@ function PaymentPolicyTab({ planId, plan }) {
|
||||
|
||||
const handleAddPromo = () => {
|
||||
const code = addForm.code.trim().toUpperCase();
|
||||
if (!code) { toast("Code is required.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
}); return; }
|
||||
if (!addForm.value || Number(addForm.value) <= 0) { toast("Value must be greater than 0.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
}); return; }
|
||||
if (promoRules.some((r) => r.code.toUpperCase() === code)) { toast("A rule with this code already exists.", {
|
||||
action: {
|
||||
label: "Close",
|
||||
onClick: () => {}
|
||||
}
|
||||
}); return; }
|
||||
if (!code) { toast("Code is required."); return; }
|
||||
if (!addForm.value || Number(addForm.value) <= 0) { toast("Value must be greater than 0."); return; }
|
||||
if (promoRules.some((r) => r.code.toUpperCase() === code)) { toast("A rule with this code already exists."); return; }
|
||||
|
||||
const rule = {
|
||||
code,
|
||||
|
||||
Reference in New Issue
Block a user