feat: update return request (#8302)
This commit is contained in:
@@ -151,6 +151,29 @@ export const useRemoveReturnItem = (
|
||||
})
|
||||
}
|
||||
|
||||
export const useUpdateReturn = (
|
||||
id: string,
|
||||
orderId: string,
|
||||
options?: UseMutationOptions<
|
||||
HttpTypes.AdminReturnResponse,
|
||||
Error,
|
||||
HttpTypes.AdminUpdateReturnRequest
|
||||
>
|
||||
) => {
|
||||
return useMutation({
|
||||
mutationFn: (payload: HttpTypes.AdminUpdateReturnRequest) => {
|
||||
return sdk.admin.return.updateRequest(id, payload)
|
||||
},
|
||||
onSuccess: (data: any, variables: any, context: any) => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ordersQueryKeys.preview(orderId),
|
||||
})
|
||||
options?.onSuccess?.(data, variables, context)
|
||||
},
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
export const useAddReturnShipping = (
|
||||
id: string,
|
||||
orderId: string,
|
||||
|
||||
Reference in New Issue
Block a user