diff --git a/packages/admin/dashboard/src/hooks/api/regions.tsx b/packages/admin/dashboard/src/hooks/api/regions.tsx index bc4133967c065..55b68d8bcbe08 100644 --- a/packages/admin/dashboard/src/hooks/api/regions.tsx +++ b/packages/admin/dashboard/src/hooks/api/regions.tsx @@ -29,7 +29,7 @@ export const useRegion = ( > ) => { const { data, ...rest } = useQuery({ - queryKey: regionsQueryKeys.detail(id), + queryKey: regionsQueryKeys.detail(id, query), queryFn: async () => sdk.admin.region.retrieve(id, query), ...options, }) @@ -95,7 +95,7 @@ export const useUpdateRegion = ( mutationFn: (payload) => sdk.admin.region.update(id, payload), onSuccess: (data, variables, context) => { queryClient.invalidateQueries({ queryKey: regionsQueryKeys.lists() }) - queryClient.invalidateQueries({ queryKey: regionsQueryKeys.detail(id) }) + queryClient.invalidateQueries({ queryKey: regionsQueryKeys.details() }) queryClient.invalidateQueries({ queryKey: pricePreferencesQueryKeys.list(), diff --git a/packages/admin/dashboard/src/routes/regions/region-detail/loader.ts b/packages/admin/dashboard/src/routes/regions/region-detail/loader.ts index 33db72a62e45a..4a0bb909a1e5d 100644 --- a/packages/admin/dashboard/src/routes/regions/region-detail/loader.ts +++ b/packages/admin/dashboard/src/routes/regions/region-detail/loader.ts @@ -7,7 +7,9 @@ import { queryClient } from "../../../lib/query-client" const regionQuery = (id: string) => ({ queryKey: regionsQueryKeys.detail(id), queryFn: async () => - sdk.admin.region.retrieve(id, { fields: "*payment_providers" }), + sdk.admin.region.retrieve(id, { + fields: "*payment_providers,*countries,+automatic_taxes", + }), }) export const regionLoader = async ({ params }: LoaderFunctionArgs) => { diff --git a/packages/admin/dashboard/src/routes/regions/region-detail/region-detail.tsx b/packages/admin/dashboard/src/routes/regions/region-detail/region-detail.tsx index b748dbfbb8d65..7a29358641a8f 100644 --- a/packages/admin/dashboard/src/routes/regions/region-detail/region-detail.tsx +++ b/packages/admin/dashboard/src/routes/regions/region-detail/region-detail.tsx @@ -23,7 +23,7 @@ export const RegionDetail = () => { error: regionError, } = useRegion( id!, - { fields: "*payment_providers,*countries" }, + { fields: "*payment_providers,*countries,+automatic_taxes" }, { initialData, } diff --git a/packages/admin/dashboard/src/routes/regions/region-edit/components/edit-region-form/edit-region-form.tsx b/packages/admin/dashboard/src/routes/regions/region-edit/components/edit-region-form/edit-region-form.tsx index b75037ea1dedc..4530a58605495 100644 --- a/packages/admin/dashboard/src/routes/regions/region-edit/components/edit-region-form/edit-region-form.tsx +++ b/packages/admin/dashboard/src/routes/regions/region-edit/components/edit-region-form/edit-region-form.tsx @@ -62,6 +62,7 @@ export const EditRegionForm = ({ currency_code: values.currency_code.toLowerCase(), payment_providers: values.payment_providers, is_tax_inclusive: values.is_tax_inclusive, + automatic_taxes: values.automatic_taxes, }, { onSuccess: () => { diff --git a/packages/admin/dashboard/src/routes/regions/region-edit/region-edit.tsx b/packages/admin/dashboard/src/routes/regions/region-edit/region-edit.tsx index 70ea76dd7e27e..1152049b0dcc9 100644 --- a/packages/admin/dashboard/src/routes/regions/region-edit/region-edit.tsx +++ b/packages/admin/dashboard/src/routes/regions/region-edit/region-edit.tsx @@ -19,7 +19,9 @@ export const RegionEdit = () => { isPending: isRegionLoading, isError: isRegionError, error: regionError, - } = useRegion(id!, { fields: "*payment_providers" }) + } = useRegion(id!, { + fields: "*payment_providers,*countries,+automatic_taxes", + }) const { store,