summaryrefslogtreecommitdiff
path: root/src-migrate/services/auth.ts
blob: 35ba290ad496d092d7852f9ce9fcbcdba2553a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import odooApi from '~/libs/odooApi';
import {
  RegisterResApiProps,
  RegisterProps,
  ActivationTokenProps,
  ActivationTokenResApiProps,
  ActivationOtpProps,
  ActivationOtpResApiProps,
  ActivationReqProps,
  ActivationReqResApiProps,
} from '~/types/auth';

const BASE_PATH = '/api/v1/user';

export const registerUser = async (
  data: RegisterProps
): Promise<RegisterResApiProps> => {
  return await odooApi('POST', `${BASE_PATH}/register`, data);
};

export const activationUserToken = async (
  params: ActivationTokenProps
): Promise<ActivationTokenResApiProps> => {
  return await odooApi('POST', `${BASE_PATH}/activation-token`, params);
};

export const activationUserOTP = async (
  params: ActivationOtpProps
): Promise<ActivationOtpResApiProps> => {
  return await odooApi('POST', `${BASE_PATH}/activation-otp`, params);
};

export const activationReq = async (
  params: ActivationReqProps
): Promise<ActivationReqResApiProps> => {
  return await odooApi('POST', `${BASE_PATH}/activation-request`, params);
};