diff --git a/packages/admin/dashboard/src/hooks/api/fulfillment.tsx b/packages/admin/dashboard/src/hooks/api/fulfillment.tsx index 0ec6c8f480..e255351cbc 100644 --- a/packages/admin/dashboard/src/hooks/api/fulfillment.tsx +++ b/packages/admin/dashboard/src/hooks/api/fulfillment.tsx @@ -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) }, diff --git a/packages/admin/dashboard/src/hooks/api/orders.tsx b/packages/admin/dashboard/src/hooks/api/orders.tsx index 45d4b565cd..0d1c2b6563 100644 --- a/packages/admin/dashboard/src/hooks/api/orders.tsx +++ b/packages/admin/dashboard/src/hooks/api/orders.tsx @@ -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({