From 01d1a2314e8645af50496578733428b1da1e51c5 Mon Sep 17 00:00:00 2001 From: Thisyahlen Date: Fri, 19 Apr 2024 09:38:23 +0800 Subject: [PATCH] chore: add useP2PAdvertInfo and useP2PAdvertiserCreate hooks --- src/api/authorize/index.tsx | 6 +++++- src/api/authorize/use-p2p-advert-info.tsx | 11 +++++++++++ src/api/authorize/use-p2p-advertiser-create.tsx | 13 +++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/api/authorize/use-p2p-advert-info.tsx create mode 100644 src/api/authorize/use-p2p-advertiser-create.tsx diff --git a/src/api/authorize/index.tsx b/src/api/authorize/index.tsx index a57adee..d3f0e15 100644 --- a/src/api/authorize/index.tsx +++ b/src/api/authorize/index.tsx @@ -23,6 +23,8 @@ import { useMt5PasswordCheck } from './use-mt5-password-check'; import { useOauthApps } from './use-oauth-apps'; import { useP2pAdvertList } from './use-p2p-advert-list'; import { useP2pAdvertiserAdverts } from './use-p2p-advertiser-adverts'; +import { useP2PAdvertInfo } from './use-p2p-advert-info'; +import { useP2PAdvertiserCreate } from './use-p2p-advertiser-create'; import { useP2pAdvertiserList } from './use-p2p-advertiser-list'; import { useP2pAdvertiserPaymentMethods } from './use-p2p-advertiser-payment-methods'; import { useP2pAdvertiserRelations } from './use-p2p-advertiser-relations'; @@ -68,8 +70,10 @@ export { useMt5LoginList, useMt5PasswordCheck, useOauthApps, - useP2pAdvertList, + useP2PAdvertInfo, useP2pAdvertiserAdverts, + useP2PAdvertiserCreate, + useP2pAdvertList, useP2pAdvertiserList, useP2pAdvertiserPaymentMethods, useP2pAdvertiserRelations, diff --git a/src/api/authorize/use-p2p-advert-info.tsx b/src/api/authorize/use-p2p-advert-info.tsx new file mode 100644 index 0000000..8f6907d --- /dev/null +++ b/src/api/authorize/use-p2p-advert-info.tsx @@ -0,0 +1,11 @@ +import { useAuthorizeQuery } from '../../base'; +import { TSocketQueryOptions } from '../../base/use-query'; + +export const useP2PAdvertInfo = ({ ...props }: Omit, 'name'> = {}) => { + const { data, ...rest } = useAuthorizeQuery({ name: 'p2p_advert_info', ...props }); + + return { + data: data?.p2p_advert_info, + ...rest, + }; +}; diff --git a/src/api/authorize/use-p2p-advertiser-create.tsx b/src/api/authorize/use-p2p-advertiser-create.tsx new file mode 100644 index 0000000..0247974 --- /dev/null +++ b/src/api/authorize/use-p2p-advertiser-create.tsx @@ -0,0 +1,13 @@ +import { useAuthorizeQuery } from '../../base'; +import { TSocketQueryOptions } from '../../base/use-query'; + +export const useP2PAdvertiserCreate = ({ + ...props +}: Omit, 'name'> = {}) => { + const { data, ...rest } = useAuthorizeQuery({ name: 'p2p_advertiser_create', ...props }); + + return { + data: data?.p2p_advertiser_create, + ...rest, + }; +};