엑셀 다운로드 관련 수정

This commit is contained in:
focp212@naver.com
2025-11-07 13:24:57 +09:00
parent 7b7c9246bf
commit 92d01ec66c
15 changed files with 62 additions and 63 deletions

View File

@@ -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),
);
};

View File

@@ -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),
);
};

View File

@@ -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),
);
};

View File

@@ -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),
);
};

View File

@@ -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),
);
};

View File

@@ -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),
);
};

View File

@@ -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,
};
};

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 {
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,
};
};