fix(dashboard): refresh order list when fulfilment status changes (#9076)
**What** - update order list when fulfillment/shipment status changes --- RESOLVES TRI-224 CLOSES [9052](https://github.com/medusajs/medusa/issues/9052)
This commit is contained in:
@@ -19,7 +19,7 @@ export const useCreateFulfillment = (
|
||||
onSuccess: (data: any, variables: any, context: any) => {
|
||||
queryClient.invalidateQueries({ queryKey: fulfillmentsQueryKeys.lists() })
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.details(),
|
||||
queryKey: ordersQueryKeys.all,
|
||||
})
|
||||
options?.onSuccess?.(data, variables, context)
|
||||
},
|
||||
@@ -36,7 +36,7 @@ export const useCancelFulfillment = (
|
||||
onSuccess: (data: any, variables: any, context: any) => {
|
||||
queryClient.invalidateQueries({ queryKey: fulfillmentsQueryKeys.lists() })
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.details(),
|
||||
queryKey: ordersQueryKeys.all,
|
||||
})
|
||||
options?.onSuccess?.(data, variables, context)
|
||||
},
|
||||
@@ -57,7 +57,7 @@ export const useCreateFulfillmentShipment = (
|
||||
sdk.admin.fulfillment.createShipment(fulfillmentId, payload),
|
||||
onSuccess: (data: any, variables: any, context: any) => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.details(),
|
||||
queryKey: ordersQueryKeys.all,
|
||||
})
|
||||
options?.onSuccess?.(data, variables, context)
|
||||
},
|
||||
|
||||
@@ -121,11 +121,7 @@ export const useCreateOrderFulfillment = (
|
||||
sdk.admin.order.createFulfillment(orderId, payload),
|
||||
onSuccess: (data: any, variables: any, context: any) => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.details(),
|
||||
})
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.preview(orderId),
|
||||
queryKey: ordersQueryKeys.all,
|
||||
})
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
@@ -148,7 +144,7 @@ export const useCancelOrderFulfillment = (
|
||||
sdk.admin.order.cancelFulfillment(orderId, fulfillmentId, payload),
|
||||
onSuccess: (data: any, variables: any, context: any) => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.details(),
|
||||
queryKey: ordersQueryKeys.all,
|
||||
})
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
@@ -175,7 +171,7 @@ export const useCreateOrderShipment = (
|
||||
sdk.admin.order.createShipment(orderId, fulfillmentId, payload),
|
||||
onSuccess: (data: any, variables: any, context: any) => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.details(),
|
||||
queryKey: ordersQueryKeys.all,
|
||||
})
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
Reference in New Issue
Block a user