Skip to content

Commit

Permalink
chore: add useBuy hook (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisyahlen-deriv authored Jul 26, 2024
1 parent 79391fe commit ba86416
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/mutation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useAppDelete } from './use-app-delete';
import { useAppRegister } from './use-app-register';
import { useAppUpdate } from './use-app-update';
import { useAuthorize } from './use-authorize';
import { useBuy } from './use-buy';
import { useBuyContractForMultipleAccounts } from './use-buy-contract-for-multiple-accounts';
import { useCancel } from './use-cancel';
import { useCashierWithdrawalCancel } from './use-cashier-withdrawal-cancel';
Expand Down Expand Up @@ -87,6 +88,7 @@ export {
useAppRegister,
useAppUpdate,
useAuthorize,
useBuy,
useBuyContractForMultipleAccounts,
useCancel,
useCashierWithdrawalCancel,
Expand Down
11 changes: 11 additions & 0 deletions src/api/mutation/use-buy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useMutation } from '../../base';
import { AugmentedMutationOptions } from '../../base/use-mutation';

export const useBuy = ({ ...props }: Omit<AugmentedMutationOptions<'buy'>, 'name'> = {}) => {
const { data, ...rest } = useMutation({ name: 'buy', ...props });

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

0 comments on commit ba86416

Please sign in to comment.