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:
Frane Polić
2024-09-09 21:06:10 +02:00
committed by GitHub
parent 6e46baa2cb
commit 0714315792
11 changed files with 65 additions and 73 deletions

View File

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

View File

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

View File

@@ -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)