fix(dashboard): stock location hook cache invalidation (#8049)

This commit is contained in:
Frane Polić
2024-07-10 20:06:36 +02:00
committed by GitHub
parent b289510b46
commit 74c19308a0
8 changed files with 7 additions and 83 deletions

View File

@@ -42,6 +42,7 @@ export const useDeleteFulfillmentSet = (
// We need to invalidate all related entities. We invalidate using `all` keys to ensure that all relevant entities are invalidated.
await queryClient.invalidateQueries({
queryKey: stockLocationsQueryKeys.all,
refetchType: "all",
})
await queryClient.invalidateQueries({
queryKey: shippingOptionsQueryKeys.all,

View File

@@ -166,10 +166,8 @@ export const useCreateStockLocationFulfillmentSet = (
sdk.admin.stockLocation.createFulfillmentSet(locationId, payload),
onSuccess: async (data, variables, context) => {
await queryClient.invalidateQueries({
queryKey: stockLocationsQueryKeys.lists(),
})
await queryClient.invalidateQueries({
queryKey: stockLocationsQueryKeys.details(),
queryKey: stockLocationsQueryKeys.all,
refetchType: "all",
})
options?.onSuccess?.(data, variables, context)