-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:binary-com/deriv-app into hamza/u…
…seTradingPlatformPasswordChange-hook-creation-and-changing-password
- Loading branch information
Showing
6 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/api/src/hooks/useTradingPlatformInvestorPasswordChange.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useCallback } from 'react'; | ||
import useRequest from '../useRequest'; | ||
|
||
type TPayload = Parameters< | ||
ReturnType<typeof useRequest<'trading_platform_investor_password_change'>>['mutate'] | ||
>[0]['payload']; | ||
|
||
/** A custom hook that change the Trading Platform Investor Password. */ | ||
const useTradingPlatformInvestorPasswordChange = () => { | ||
const { mutate: _mutate, ...rest } = useRequest('trading_platform_investor_password_change'); | ||
|
||
/** @param payload - The payload to be sent to the server */ | ||
const mutate = useCallback((payload: TPayload) => _mutate({ payload }), [_mutate]); | ||
|
||
return { | ||
/** The mutation function that accepts a payload and sends it to the server */ | ||
mutate, | ||
...rest, | ||
}; | ||
}; | ||
|
||
export default useTradingPlatformInvestorPasswordChange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useCallback } from 'react'; | ||
import { useRequest } from '@deriv/api'; | ||
|
||
type TPayload = Parameters<ReturnType<typeof useRequest<'verify_email'>>['mutate']>[0]['payload']; | ||
|
||
/** A custom hook for verifying email address */ | ||
const useVerifyEmail = () => { | ||
const { mutate: _mutate, ...rest } = useRequest('verify_email'); | ||
|
||
const mutate = useCallback((payload: TPayload) => _mutate({ payload }), [_mutate]); | ||
|
||
return { | ||
/** The mutation function that accepts a payload and sends it to the server */ | ||
mutate, | ||
...rest, | ||
}; | ||
}; | ||
|
||
export default useVerifyEmail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters