정산조회 - 정산내역 리스트 및 상세
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_SETTLEMENT } from '@/shared/api/api-url-settlement';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
SettlementsHistoryParams,
|
||||
SettlementsHistoryResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const settlementsHistory = (params: SettlementsHistoryParams) => {
|
||||
return resultify(
|
||||
axios.post<SettlementsHistoryResponse>(API_URL_SETTLEMENT.settlementsHistory(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useSettlementsHistoryMutation = (options?: UseMutationOptions<SettlementsHistoryResponse, CBDCAxiosError, SettlementsHistoryParams>) => {
|
||||
const mutation = useMutation<SettlementsHistoryResponse, CBDCAxiosError, SettlementsHistoryParams>({
|
||||
...options,
|
||||
mutationFn: (params: SettlementsHistoryParams) => settlementsHistory(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user