엑셀 다운로드 관련 수정
This commit is contained in:
@@ -16,7 +16,7 @@ import { ListSummaryExtendTransaction } from './list-summary-extend-transaction'
|
||||
import SlideDown from 'react-slidedown';
|
||||
import 'react-slidedown/lib/slidedown.css';
|
||||
import { ListFilter } from './filter/list-filter';
|
||||
import { useDownloadExcelMutation } from '@/entities/transaction/api/use-download-excel-mutation';
|
||||
|
||||
import {
|
||||
SettlementPeriodType,
|
||||
SettlementPaymentMethod,
|
||||
@@ -90,8 +90,7 @@ export const ListWrap = ({
|
||||
const { mutateAsync: settlementsHistorySummary} = useSettlementsHistorySummaryMutation();
|
||||
const { mutateAsync: settlementsTransactionList } = useSettlementsTransactionListMutation();
|
||||
const { mutateAsync: settlementsTransactionSummary } = useSettlementsTransactionSummaryMutation();
|
||||
const { mutateAsync: downloadExcel } = useDownloadExcelMutation();
|
||||
|
||||
|
||||
const callList = (type?: string) => {
|
||||
setOnActionIntersect(false);
|
||||
if(periodType === SettlementPeriodType.SETTLEMENT_DATE){
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
};
|
||||
@@ -594,6 +594,12 @@ export interface DownloadExcelParams {
|
||||
export interface DownloadExcelResponse {
|
||||
|
||||
};
|
||||
export interface TransactionDownloadExcelParams extends AllTransactionListParams {
|
||||
email: string;
|
||||
};
|
||||
export interface TransactionDownloadExcelResponse {};
|
||||
|
||||
|
||||
export interface AllTransactionCancelParams{
|
||||
tid: string;
|
||||
cancelAmount: number;
|
||||
|
||||
Reference in New Issue
Block a user