api 추가

This commit is contained in:
focp212@naver.com
2025-11-11 09:14:34 +09:00
parent 237eedf805
commit a7c980dff8
4 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
import axios from 'axios';
import { API_URL_TRANSACTION } from '@/shared/api/api-url-transaction';
import { resultify } from '@/shared/lib/resultify';
import { NiceAxiosError } from '@/shared/@types/error';
import {
EscrowDownloadExcelParams,
EscrowDownloadExcelResponse
} from '../model/types';
import {
useMutation,
UseMutationOptions
} from '@tanstack/react-query';
import { getHeaderUserAgent } from '@/shared/constants/url';
export const escrowDownloadExcelList = (params: EscrowDownloadExcelParams) => {
let headerOptions = {
menuId: 33,
apiType: 'DOWNLOAD'
};
let options = {
headers: {
'X-User-Agent': getHeaderUserAgent(headerOptions)
}
};
return resultify(
axios.post<EscrowDownloadExcelResponse>(API_URL_TRANSACTION.escrowList(), params, options),
);
};
export const useEscrowListMutation = (options?: UseMutationOptions<EscrowDownloadExcelResponse, NiceAxiosError, EscrowDownloadExcelParams>) => {
const mutation = useMutation<EscrowDownloadExcelResponse, NiceAxiosError, EscrowDownloadExcelParams>({
...options,
mutationFn: (params: EscrowDownloadExcelParams) => escrowDownloadExcelList(params),
});
return {
...mutation,
};
};

View File

@@ -321,6 +321,16 @@ export interface EscrowListParams {
page?: DefaultRequestPagination;
};
export interface EscrowDownloadExcelParams {
email: string;
mid: string;
startDate: string;
endDate: string;
deliveryStatus: EscrowDeliveryStatus;
settlementStatus: EscrowSettlementStatus;
};
export interface EscrowDownloadExcelResponse {};
export interface BillingListParams {
mid?: string;
searchType?: string;