From e73e95f5e906fe0be9be2ad6219c0715060c3df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frane=20Poli=C4=87?= <16856471+fPolic@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:50:19 +0200 Subject: [PATCH] fix(dashboard): location details loader (#9412) **What** - fix location loader returning stale data if SL details are fetched with another field params **Why** - if we visit the order details page and visit location details afterwards, delivery and pickup will appear disabled because a new query with `fulfillment_sets` is not fetched --- .../dashboard/src/routes/locations/location-detail/loader.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/admin/dashboard/src/routes/locations/location-detail/loader.ts b/packages/admin/dashboard/src/routes/locations/location-detail/loader.ts index 66c525e8d8..07d435ef14 100644 --- a/packages/admin/dashboard/src/routes/locations/location-detail/loader.ts +++ b/packages/admin/dashboard/src/routes/locations/location-detail/loader.ts @@ -8,7 +8,9 @@ import { queryClient } from "../../../lib/query-client" import { detailsFields } from "./const" const locationQuery = (id: string) => ({ - queryKey: stockLocationsQueryKeys.detail(id), + queryKey: stockLocationsQueryKeys.detail(id, { + fields: detailsFields, + }), queryFn: async () => { return await sdk.admin.stockLocation .retrieve(id, {