summaryrefslogtreecommitdiff
path: root/src-migrate/services/auth.ts
blob: a5d027541aed4f008aa5bf756128e52857dcb560 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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;
};