fix docs
This commit is contained in:
13
src/features/b2b/hooks/useCreatePurchaseRequest.ts
Normal file
13
src/features/b2b/hooks/useCreatePurchaseRequest.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { createPurchaseRequest } from '../api/b2bApi'
|
||||
|
||||
export function useCreatePurchaseRequest() {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
return useMutation({
|
||||
mutationFn: createPurchaseRequest,
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['b2b', 'purchase-requests'] })
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user