엑셀 다운로드 관련 수정
This commit is contained in:
@@ -23,7 +23,7 @@ export const allTransactionCancelInfo = (params: AllTransactionCancelInfoParams)
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<AllTransactionCancelInfoResponse>(API_URL_TRANSACTION.allTransactionCancelInfo(), params, options),
|
||||
axios.post<AllTransactionCancelInfoResponse>(API_URL_TRANSACTION.transactionCancelInfo(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export const allTransactionCancel = (params: AllTransactionCancelParams) => {
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<AllTransactionCancelResponse>(API_URL_TRANSACTION.allTransactionCancel(), params, options),
|
||||
axios.post<AllTransactionCancelResponse>(API_URL_TRANSACTION.transactionCancel(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export const allTransactionDetail = (params: AllTransactionDetailParams) => {
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<DetailResponse>(API_URL_TRANSACTION.allTransactionDetail(), params, options),
|
||||
axios.post<DetailResponse>(API_URL_TRANSACTION.transactionDetail(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export const allTransactionList = (params: AllTransactionListParams) => {
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<AllTransactionListResponse>(API_URL_TRANSACTION.allTransactionList(), params, options),
|
||||
axios.post<AllTransactionListResponse>(API_URL_TRANSACTION.transactionList(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export const allTransactionListSummary = (params: AllTransactionListSummaryParam
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<AllTransactionListSummaryResponse>(API_URL_TRANSACTION.allTransactionListSummary(), params, options),
|
||||
axios.post<AllTransactionListSummaryResponse>(API_URL_TRANSACTION.transactionListSummary(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export const downloadConfirmation = (params: DownloadConfirmationParams) => {
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<DownloadConfirmationResponse>(API_URL_TRANSACTION.downloadConfirmation(), params, options),
|
||||
axios.post<DownloadConfirmationResponse>(API_URL_TRANSACTION.transactionDownloadConfirmation(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
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 {
|
||||
DownloadExcelParams,
|
||||
DownloadExcelResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
import { getHeaderUserAgent } from '@/shared/constants/url';
|
||||
|
||||
export const downloadExcel = (params: DownloadExcelParams) => {
|
||||
let headerOptions = {
|
||||
menuId: 31,
|
||||
apiType: 'DOWNLOAD'
|
||||
};
|
||||
let options = {
|
||||
headers: {
|
||||
'X-User-Agent': getHeaderUserAgent(headerOptions)
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<DownloadExcelResponse>(API_URL_TRANSACTION.downloadExcel(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
export const useDownloadExcelMutation = (options?: UseMutationOptions<DownloadExcelResponse, NiceAxiosError, DownloadExcelParams>) => {
|
||||
const mutation = useMutation<DownloadExcelResponse, NiceAxiosError, DownloadExcelParams>({
|
||||
...options,
|
||||
mutationFn: (params: DownloadExcelParams) => downloadExcel(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -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 {
|
||||
TransactionDownloadExcelParams,
|
||||
TransactionDownloadExcelResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
import { getHeaderUserAgent } from '@/shared/constants/url';
|
||||
|
||||
export const transactionDownloadExcel = (params: TransactionDownloadExcelParams) => {
|
||||
let headerOptions = {
|
||||
menuId: 31,
|
||||
apiType: 'DOWNLOAD'
|
||||
};
|
||||
let options = {
|
||||
headers: {
|
||||
'X-User-Agent': getHeaderUserAgent(headerOptions)
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<TransactionDownloadExcelResponse>(API_URL_TRANSACTION.transactionDownloadExcel(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
export const useTransactionDownloadExcelMutation = (options?: UseMutationOptions<TransactionDownloadExcelResponse, NiceAxiosError, TransactionDownloadExcelParams>) => {
|
||||
const mutation = useMutation<TransactionDownloadExcelResponse, NiceAxiosError, TransactionDownloadExcelParams>({
|
||||
...options,
|
||||
mutationFn: (params: TransactionDownloadExcelParams) => transactionDownloadExcel(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user