api 추가
This commit is contained in:
@@ -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,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -321,6 +321,16 @@ export interface EscrowListParams {
|
|||||||
page?: DefaultRequestPagination;
|
page?: DefaultRequestPagination;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export interface EscrowDownloadExcelParams {
|
||||||
|
email: string;
|
||||||
|
mid: string;
|
||||||
|
startDate: string;
|
||||||
|
endDate: string;
|
||||||
|
deliveryStatus: EscrowDeliveryStatus;
|
||||||
|
settlementStatus: EscrowSettlementStatus;
|
||||||
|
};
|
||||||
|
export interface EscrowDownloadExcelResponse {};
|
||||||
|
|
||||||
export interface BillingListParams {
|
export interface BillingListParams {
|
||||||
mid?: string;
|
mid?: string;
|
||||||
searchType?: string;
|
searchType?: string;
|
||||||
|
|||||||
@@ -132,7 +132,9 @@ export const ListWrap = () => {
|
|||||||
selectedMode: DownloadSelectedMode,
|
selectedMode: DownloadSelectedMode,
|
||||||
userEmail?: string
|
userEmail?: string
|
||||||
) => {
|
) => {
|
||||||
|
if(selectedMode === DownloadSelectedMode.IMAGE){
|
||||||
|
setTaxInvoiceSampleOn(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ export const API_URL_TRANSACTION = {
|
|||||||
// POST: 에스크로 메일 재발송
|
// POST: 에스크로 메일 재발송
|
||||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/mail/resend`;
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/mail/resend`;
|
||||||
},
|
},
|
||||||
|
escrowDownloadExcel: () => {
|
||||||
|
// POST: 에스크로 거래내역 엑셀 다운로드
|
||||||
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/escrows/download/excel`;
|
||||||
|
},
|
||||||
|
|
||||||
/* Billing Management - 빌링 API */
|
/* Billing Management - 빌링 API */
|
||||||
billingList: () => {
|
billingList: () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user