Files
nice-app-web/src/entities/additional-service/api/fund-account/use-extension-fund-account-transfer-excel-mutation.ts
2025-09-22 19:04:57 +09:00

30 lines
1.2 KiB
TypeScript

import axios from 'axios';
import { API_URL_ADDITIONAL_SERVICE } from '@/shared/api/api-url-additional-service';
import { resultify } from '@/shared/lib/resultify';
import { CBDCAxiosError } from '@/shared/@types/error';
import {
ExtensionFundAccountTransferExcelParams,
ExtensionFundAccountTransferExcelResponse
} from '../../model/fund-account/types';
import {
useMutation,
UseMutationOptions
} from '@tanstack/react-query';
export const extensionFundAccountTransferExcel = (params: ExtensionFundAccountTransferExcelParams) => {
return resultify(
axios.post<ExtensionFundAccountTransferExcelResponse>(API_URL_ADDITIONAL_SERVICE.extensionFundAccountTransferExcel(), params),
);
};
export const useExtensionFundAccountTransferExcelMutation = (options?: UseMutationOptions<ExtensionFundAccountTransferExcelResponse, CBDCAxiosError, ExtensionFundAccountTransferExcelParams>) => {
const mutation = useMutation<ExtensionFundAccountTransferExcelResponse, CBDCAxiosError, ExtensionFundAccountTransferExcelParams>({
...options,
mutationFn: (params: ExtensionFundAccountTransferExcelParams) => extensionFundAccountTransferExcel(params),
});
return {
...mutation,
};
};