세금계산서 엑셀다운로드 추가
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_VAT_RETURN } from '@/shared/api/api-url-vat-return';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
VatReturnDownloadExcelParams,
|
||||
VatReturnDownloadExcelResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
import { getHeaderUserAgent } from '@/shared/constants/url';
|
||||
|
||||
export const vatReturnDownloadExcel = (params: VatReturnDownloadExcelParams) => {
|
||||
let headerOptions = {
|
||||
menuId: 48,
|
||||
apiType: 'SELECT'
|
||||
};
|
||||
let options = {
|
||||
headers: {
|
||||
'X-User-Agent': getHeaderUserAgent(headerOptions)
|
||||
}
|
||||
};
|
||||
return resultify(
|
||||
axios.post<VatReturnDownloadExcelResponse>(API_URL_VAT_RETURN.vatReturnDownloadExcel(), params, options),
|
||||
);
|
||||
};
|
||||
|
||||
export const useVatReturnDownloadExcelMutation = (options?: UseMutationOptions<VatReturnDownloadExcelResponse, NiceAxiosError, VatReturnDownloadExcelParams>) => {
|
||||
const mutation = useMutation<VatReturnDownloadExcelResponse, NiceAxiosError, VatReturnDownloadExcelParams>({
|
||||
...options,
|
||||
mutationFn: (params: VatReturnDownloadExcelParams) => vatReturnDownloadExcel(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user