use update_policy

This commit is contained in:
Sebastian 2021-11-05 11:26:12 -03:00
parent 543ed2a106
commit 4a8e4b9026
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -24,14 +24,10 @@ export function ReviewPoliciesScreen(): VNode {
<EditPoliciesScreen <EditPoliciesScreen
index={editingPolicy} index={editingPolicy}
cancel={() => setEditingPolicy(undefined)} cancel={() => setEditingPolicy(undefined)}
confirm={(newMethods) => { confirm={async (newMethods) => {
reducer.runTransaction(async (tx) => { await reducer.transition("update_policy", {
await tx.transition("delete_policy", { policy_index: editingPolicy,
policy_index: editingPolicy policy: newMethods,
});
await tx.transition("add_policy", {
policy: newMethods
});
}); });
setEditingPolicy(undefined) setEditingPolicy(undefined)
}} }}