catch 수정 및 불필요 api 삭제 api 변경 내역 수정
This commit is contained in:
@@ -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 {
|
||||
DownloadConfirmationParams,
|
||||
DownloadConfirmationResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
import { getHeaderUserAgent } from '@/shared/constants/url';
|
||||
|
||||
export const downloadConfirmation = (params: DownloadConfirmationParams) => {
|
||||
let headerOptions = {
|
||||
menuId: 31,
|
||||
apiType: 'DOWNLOAD'
|
||||
};
|
||||
let options = {
|
||||
headers: {
|
||||
'X-User-Agent': getHeaderUserAgent(headerOptions)
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<DownloadConfirmationResponse>(API_URL_TRANSACTION.transactionDownloadConfirmation(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
export const useDownloadConfirmationMutation = (options?: UseMutationOptions<DownloadConfirmationResponse, NiceAxiosError, DownloadConfirmationParams>) => {
|
||||
const mutation = useMutation<DownloadConfirmationResponse, NiceAxiosError, DownloadConfirmationParams>({
|
||||
...options,
|
||||
mutationFn: (params: DownloadConfirmationParams) => downloadConfirmation(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user