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
This commit is contained in:
Frane Polić
2024-10-02 16:50:19 +02:00
committed by GitHub
parent ab7e71a055
commit e73e95f5e9

View File

@@ -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, {