summaryrefslogtreecommitdiff
path: root/src-migrate/services/auth.ts
blob: 1cc09c10cb4a1e80c96809802bc8ca20b202e427 (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 '~/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> => {
  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);
};