summaryrefslogtreecommitdiff
path: root/src-migrate/services/auth.ts
blob: feaabec80a2f3678be72d74628199426726264bd (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
import odooApi from '~/common/libs/odooApi';
import {
  RegisterResApiProps,
  RegisterProps,
  ActivationTokenProps,
  ActivationTokenResApiProps,
  ActivationOtpProps,
  ActivationOtpResApiProps,
} 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;
};