summaryrefslogtreecommitdiff
path: root/src-migrate/services/auth.ts
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-25 17:27:32 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-25 17:27:32 +0700
commitcf6da809621b4ebe8c9acedb035b689e7e1b60b1 (patch)
tree5b5a80f7b13066bf3a2342242d6e4fce4b25b5b2 /src-migrate/services/auth.ts
parent90710579ba1c12060877f6ec2d26103f9c31058d (diff)
Update register page
Diffstat (limited to 'src-migrate/services/auth.ts')
-rw-r--r--src-migrate/services/auth.ts35
1 files changed, 32 insertions, 3 deletions
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<RegisterApiProps> => {
- const response = await odooApi('POST', '/api/v1/user/register', data);
+): 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;
};