mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-05 15:26:35 +00:00
Fix saving the rules
This commit is contained in:
@@ -750,10 +750,19 @@ export function EditPolicyRulesSectionForm({
|
||||
return;
|
||||
}
|
||||
|
||||
const isValid = form.trigger();
|
||||
const isValid = await form.trigger();
|
||||
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 {
|
||||
const res = await api
|
||||
|
||||
Reference in New Issue
Block a user