Skip to content

Commit

Permalink
Merge pull request #31 from thisyahlen-deriv/thisyahlen/p2p-advert-an…
Browse files Browse the repository at this point in the history
…d-advertiser-hooks

chore: add useP2PAdvertInfo and useP2PAdvertiserCreate hooks
  • Loading branch information
jim-deriv authored Apr 19, 2024
2 parents 4b87d7a + 01d1a23 commit 39b8611
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/authorize/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -68,8 +70,10 @@ export {
useMt5LoginList,
useMt5PasswordCheck,
useOauthApps,
useP2pAdvertList,
useP2PAdvertInfo,
useP2pAdvertiserAdverts,
useP2PAdvertiserCreate,
useP2pAdvertList,
useP2pAdvertiserList,
useP2pAdvertiserPaymentMethods,
useP2pAdvertiserRelations,
Expand Down
11 changes: 11 additions & 0 deletions src/api/authorize/use-p2p-advert-info.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useAuthorizeQuery } from '../../base';
import { TSocketQueryOptions } from '../../base/use-query';

export const useP2PAdvertInfo = ({ ...props }: Omit<TSocketQueryOptions<'p2p_advert_info'>, 'name'> = {}) => {
const { data, ...rest } = useAuthorizeQuery({ name: 'p2p_advert_info', ...props });

return {
data: data?.p2p_advert_info,
...rest,
};
};
13 changes: 13 additions & 0 deletions src/api/authorize/use-p2p-advertiser-create.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { useAuthorizeQuery } from '../../base';
import { TSocketQueryOptions } from '../../base/use-query';

export const useP2PAdvertiserCreate = ({
...props
}: Omit<TSocketQueryOptions<'p2p_advertiser_create'>, 'name'> = {}) => {
const { data, ...rest } = useAuthorizeQuery({ name: 'p2p_advertiser_create', ...props });

return {
data: data?.p2p_advertiser_create,
...rest,
};
};

0 comments on commit 39b8611

Please sign in to comment.