Skip to content

Commit

Permalink
Merge pull request #38 from thisyahlen-deriv/thisyahlen/modify-new-ac…
Browse files Browse the repository at this point in the history
…count-virtual-to-follow-authorise

chore: modify useNewAccountVirtual to use useMutation from tanstack
  • Loading branch information
jim-deriv authored Apr 23, 2024
2 parents eb0d767 + cd6d468 commit 12d0b75
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/api/mutation/use-new-account-virtual.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { useMutation } from '../../base';
import { useMutation as useReactQueryMutation } from '@tanstack/react-query';
import { useAPI } from '../../base/use-context-hooks';
import { AugmentedMutationOptions } from '../../base/use-mutation';

export const useNewAccountVirtual = ({
...props
...options
}: Omit<AugmentedMutationOptions<'new_account_virtual'>, 'name'> = {}) => {
const { data, ...rest } = useMutation({ name: 'new_account_virtual', ...props });
const { send } = useAPI();

return {
data: data?.new_account_virtual,
...rest,
};
return useReactQueryMutation({
mutationFn: payload => send('new_account_virtual', payload),
...options,
});
};

0 comments on commit 12d0b75

Please sign in to comment.