부가서비스
- 링크결제 결제신청 API 연결
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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 {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
import { ExtensionLinkPayRequestParams, ExtensionLinkPayRequestResponse } from '../../model/types';
|
||||
|
||||
export const extensionLinkPayRequest = (params: ExtensionLinkPayRequestParams) => {
|
||||
return resultify(
|
||||
axios.post<ExtensionLinkPayRequestResponse>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentRequest(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useExtensionLinkPayRequestMutation = (options?: UseMutationOptions<ExtensionLinkPayRequestResponse, CBDCAxiosError, ExtensionLinkPayRequestParams>) => {
|
||||
const mutation = useMutation<ExtensionLinkPayRequestResponse, CBDCAxiosError, ExtensionLinkPayRequestParams>({
|
||||
...options,
|
||||
mutationFn: (params: ExtensionLinkPayRequestParams) => extensionLinkPayRequest(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -13,7 +13,7 @@ import { ExtensionLinkPayWaitDeleteParams } from '../../model/types';
|
||||
|
||||
export const extensionLinkPayWaitDelete = async (params: ExtensionLinkPayWaitDeleteParams)=> {
|
||||
return resultify(
|
||||
axios.post<ExtensionLinkPayWaitDeleteRespone>(API_URL_ADDITIONAL_SERVICE.extensionLinkPayMentWaitDelete(), params)
|
||||
axios.post<ExtensionLinkPayWaitDeleteRespone>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentWaitDelete(), params)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user