fix(dashboard): rq cache and pending flag (#9063)
**What** - fix issues from stale data on modal pages --- FIXES CC-137
This commit is contained in:
@@ -42,7 +42,6 @@ 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,
|
||||
|
||||
@@ -97,7 +97,7 @@ export const useCancelReturn = (
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.preview(orderId),
|
||||
refetchType: "all",
|
||||
refetchType: "all", // We want preview to be updated in the cache immediately
|
||||
})
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
@@ -163,7 +163,7 @@ export const useCancelReturnRequest = (
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.preview(orderId),
|
||||
refetchType: "all",
|
||||
refetchType: "all", // We want preview to be updated in the cache immediately
|
||||
})
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
@@ -625,7 +625,7 @@ export const useCancelReceiveReturn = (
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.preview(orderId),
|
||||
refetchType: "all", // For some reason RQ will refetch this but will return stale record from the cache
|
||||
refetchType: "all", // We want preview to be updated in the cache immediately
|
||||
})
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
@@ -168,7 +168,6 @@ export const useCreateStockLocationFulfillmentSet = (
|
||||
onSuccess: async (data, variables, context) => {
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: stockLocationsQueryKeys.all,
|
||||
refetchType: "all",
|
||||
})
|
||||
|
||||
options?.onSuccess?.(data, variables, context)
|
||||
|
||||
Reference in New Issue
Block a user