fix(dashboard): stock location hook cache invalidation (#8049)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user