- 부가서비스 소개 List, 권한 검증 추가
- 각 API 오류 수정
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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 {
|
||||
ExtensionCheckParams,
|
||||
ExtensionCheckResponse,
|
||||
ExtensionListParams,
|
||||
ExtensionListResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const extensionCheck = (params: ExtensionCheckParams) => {
|
||||
return resultify(
|
||||
axios.post<ExtensionCheckResponse>(API_URL_ADDITIONAL_SERVICE.extensionCheck(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useExtensionCheckMutation = (options?: UseMutationOptions<ExtensionCheckResponse, CBDCAxiosError, ExtensionCheckParams>) => {
|
||||
const mutation = useMutation<ExtensionCheckResponse, CBDCAxiosError, ExtensionCheckParams>({
|
||||
...options,
|
||||
mutationFn: (params: ExtensionCheckParams) => extensionCheck(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user