feat: похуйу
This commit is contained in:
12
src/features/payment/hooks/useCreateOrder.ts
Normal file
12
src/features/payment/hooks/useCreateOrder.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
import { createOrder } from '../api/paymentApi'
|
||||
|
||||
export function useCreateOrder() {
|
||||
return useMutation({
|
||||
mutationFn: createOrder,
|
||||
onSuccess: (data) => {
|
||||
const url = data.order.itpay_payment_qr_url_desktop
|
||||
if (url) window.location.href = url
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user