14 lines
506 B
TypeScript
14 lines
506 B
TypeScript
import type { RequestTransTax, ResponseTransTax } from './types';
|
|
import getUrls from '@/config/urls';
|
|
import { withHandleError } from '@/utils/axios';
|
|
import type { QueryFunctionContext } from '@tanstack/react-query';
|
|
import axios from 'axios';
|
|
|
|
const { URL_1C_TRANSTAX } = getUrls();
|
|
|
|
export function getTransTax(payload: RequestTransTax, { signal }: QueryFunctionContext) {
|
|
return withHandleError(
|
|
axios.post<ResponseTransTax>(URL_1C_TRANSTAX, payload, { signal }).then(({ data }) => data)
|
|
);
|
|
}
|