mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-07 16:18:47 +00:00
Fix saving the rules
This commit is contained in:
@@ -750,10 +750,19 @@ export function EditPolicyRulesSectionForm({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isValid = form.trigger();
|
const isValid = await form.trigger();
|
||||||
if (!isValid) return;
|
if (!isValid) return;
|
||||||
|
|
||||||
const payload = form.getValues();
|
const payload = {
|
||||||
|
applyRules: form.getValues("applyRules") ?? false,
|
||||||
|
rules: rules.map(({ action, match, value, priority, enabled }) => ({
|
||||||
|
action,
|
||||||
|
match,
|
||||||
|
value,
|
||||||
|
priority,
|
||||||
|
enabled
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api
|
const res = await api
|
||||||
|
|||||||
Reference in New Issue
Block a user