diff options
Diffstat (limited to 'src-migrate/services/auth.ts')
| -rw-r--r-- | src-migrate/services/auth.ts | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src-migrate/services/auth.ts b/src-migrate/services/auth.ts new file mode 100644 index 00000000..a5d02754 --- /dev/null +++ b/src-migrate/services/auth.ts @@ -0,0 +1,53 @@ +import odooApi from '~/common/libs/odooApi'; +import { + RegisterResApiProps, + RegisterProps, + ActivationTokenProps, + ActivationTokenResApiProps, + ActivationOtpProps, + ActivationOtpResApiProps, + ActivationReqProps, + ActivationReqResApiProps, +} from '~/common/types/auth'; + +const BASE_PATH = '/api/v1/user'; + +export const registerUser = async ( + data: RegisterProps +): Promise<RegisterResApiProps> => { + const response = await odooApi('POST', `${BASE_PATH}/register`, data); + + return response; +}; + +export const activationUserToken = async ( + params: ActivationTokenProps +): Promise<ActivationTokenResApiProps> => { + const response = await odooApi( + 'POST', + `${BASE_PATH}/activation-token`, + params + ); + + return response; +}; + +export const activationUserOTP = async ( + params: ActivationOtpProps +): Promise<ActivationOtpResApiProps> => { + const response = await odooApi('POST', `${BASE_PATH}/activation-otp`, params); + + return response; +}; + +export const activationReq = async ( + params: ActivationReqProps +): Promise<ActivationReqResApiProps> => { + const response = await odooApi( + 'POST', + `${BASE_PATH}/activation-request`, + params + ); + + return response; +}; |
