From 4d7594ca2174f74bfa9f66a464b77b3fd04f3560 Mon Sep 17 00:00:00 2001 From: Paul Hachmang Date: Thu, 15 Feb 2024 14:24:25 +0100 Subject: [PATCH] After changing the default shipping or billing address in the account section other address would not properly update --- .changeset/quick-vans-sniff.md | 5 +++++ .../UpdateDefaultAddressForm/UpdateDefaultAddressForm.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/quick-vans-sniff.md diff --git a/.changeset/quick-vans-sniff.md b/.changeset/quick-vans-sniff.md new file mode 100644 index 0000000000..36e5b2f776 --- /dev/null +++ b/.changeset/quick-vans-sniff.md @@ -0,0 +1,5 @@ +--- +"@graphcommerce/magento-customer": patch +--- + +After changing the default shipping or billing address in the account section other address would not properly update diff --git a/packages/magento-customer/components/UpdateDefaultAddressForm/UpdateDefaultAddressForm.tsx b/packages/magento-customer/components/UpdateDefaultAddressForm/UpdateDefaultAddressForm.tsx index 6868e904e4..55e5ae06c0 100644 --- a/packages/magento-customer/components/UpdateDefaultAddressForm/UpdateDefaultAddressForm.tsx +++ b/packages/magento-customer/components/UpdateDefaultAddressForm/UpdateDefaultAddressForm.tsx @@ -26,7 +26,7 @@ export function UpdateDefaultAddressForm(props: UpdateDefaultAddressFormProps) { const form = useFormGqlMutation( UpdateDefaultAddressDocument, { mode: 'onChange', defaultValues }, - { errorPolicy: 'all' }, + { errorPolicy: 'all', refetchQueries: ['AccountDashboardAddresses'] }, ) const { handleSubmit, control, error, reset, formState } = form