Skip to content

Commit

Permalink
fix(app): remove extra param for update policy mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
hbriese committed Jul 29, 2024
1 parent bf83020 commit fce7023
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/components/policy/PolicyPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useAtom } from 'jotai';
import _ from 'lodash';
import { PolicyAppbar } from '#/policy/PolicyAppbar';
import { usePolicyDraftAtom, asPolicyInput, PolicyDraft } from '~/lib/policy/policyAsDraft';
import { showError } from '#/provider/SnackbarProvider';
import { ApprovalSettings } from '#/policy/ApprovalSettings';
import { SpendingSettings } from '#/policy/SpendingSettings';
import { ActionsSettings } from '#/policy/ActionsSettings';
Expand Down Expand Up @@ -119,9 +118,11 @@ export function PolicyPane({ initial, ...props }: PolicyPaneProps) {
icon={draft.key === undefined ? AddIcon : UpdateIcon}
label={draft.key === undefined ? 'Create policy' : 'Update policy'}
onPress={async () => {
const input = { account: draft.account, ...asPolicyInput(draft) };
const r = (await propose({ input: { account: input.account, policies: [input] } }))
.proposePolicies?.[0];
const r = (
await propose({
input: { account: draft.account, policies: [asPolicyInput(draft)] },
})
).proposePolicies?.[0];

const p = r.draft ?? r;
router.setParams({ ...params, id: p.id });
Expand Down

0 comments on commit fce7023

Please sign in to comment.