From cf6da809621b4ebe8c9acedb035b689e7e1b60b1 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 25 Oct 2023 17:27:32 +0700 Subject: Update register page --- src-migrate/services/auth.ts | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'src-migrate/services/auth.ts') diff --git a/src-migrate/services/auth.ts b/src-migrate/services/auth.ts index f2fd7761..feaabec8 100644 --- a/src-migrate/services/auth.ts +++ b/src-migrate/services/auth.ts @@ -1,10 +1,39 @@ import odooApi from '~/common/libs/odooApi'; -import { RegisterApiProps, RegisterProps } from '~/common/types/auth'; +import { + RegisterResApiProps, + RegisterProps, + ActivationTokenProps, + ActivationTokenResApiProps, + ActivationOtpProps, + ActivationOtpResApiProps, +} from '~/common/types/auth'; + +const BASE_PATH = '/api/v1/user'; export const registerUser = async ( data: RegisterProps -): Promise => { - const response = await odooApi('POST', '/api/v1/user/register', data); +): Promise => { + const response = await odooApi('POST', `${BASE_PATH}/register`, data); + + return response; +}; + +export const activationUserToken = async ( + params: ActivationTokenProps +): Promise => { + const response = await odooApi( + 'POST', + `${BASE_PATH}/activation-token`, + params + ); + + return response; +}; + +export const activationUserOTP = async ( + params: ActivationOtpProps +): Promise => { + const response = await odooApi('POST', `${BASE_PATH}/activation-otp`, params); return response; }; -- cgit v1.2.3