test
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_PAYMENT } from '@/shared/api/api-url-payment';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
PaymentInstallmentDetailParams,
|
||||
PaymentInstallmentDetailResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const paymentInstallmentDetail = (params: PaymentInstallmentDetailParams) => {
|
||||
return resultify(
|
||||
axios.post<PaymentInstallmentDetailResponse>(API_URL_PAYMENT.paymentInstallmentDetail(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const usePaymentInstallmentDetailMutation = (options?: UseMutationOptions<PaymentInstallmentDetailResponse, CBDCAxiosError, PaymentInstallmentDetailParams>) => {
|
||||
const mutation = useMutation<PaymentInstallmentDetailResponse, CBDCAxiosError, PaymentInstallmentDetailParams>({
|
||||
...options,
|
||||
mutationFn: (params: PaymentInstallmentDetailParams) => paymentInstallmentDetail(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user