users.js 2.62 KB
Newer Older
Giang Tran committed
1
import {PostLogin, PostData, GetData, PostFormData} from '../helpers';
Giang Tran committed
2 3 4 5

import url from '../url';

export const loginApi = async (body) =>
Giang Tran committed
6
  PostLogin(url.urllogin, body)
Giang Tran committed
7 8 9
    .then((res) => res)
    .catch((err) => err);

Giang Tran committed
10 11 12 13 14
export const registorApi = async (body) =>
  PostLogin(url.urlRegistor, body)
    .then((res) => res)
    .catch((err) => err);

Giang Tran committed
15
export const logoutApi = async (body) =>
Giang Tran committed
16
  PostData(urlLogout, body)
Giang Tran committed
17 18
    .then((res) => res)
    .catch((err) => err);
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

export const getOTPApi = async (body) =>
  PostLogin(url.urlGetOTP, body)
    .then((res) => res)
    .catch((err) => err);

export const verifyOTPApi = async (body) =>
  PostLogin(url.urlVerifyOTP, body)
    .then((res) => res)
    .catch((err) => err);

export const forgotPasswordApi = async (body) =>
  PostLogin(url.urlForgotPassword, body)
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
34 35

export const verifyAccountApi = async (body) =>
Giang Tran committed
36
  PostData(url.urlVerifyAccount, body)
Giang Tran committed
37 38
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
39 40 41 42 43

export const getTransaction = async (body) =>
  GetData(url.urlGetTransaction, body)
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
44 45 46 47 48

export const getListNotification = async (body) =>
  GetData(url.urlGetListNotification, body)
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
49 50 51 52 53

export const updateInforUser = async (body) =>
  PostData(url.urlUpdateInforUser, body)
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
54 55 56 57 58

export const updateLangugeApi = async (body) =>
  PostData(url.urlUpdateLanguage, body)
    .then((res) => res)
    .catch((err) => err);
Nguyễn Thị Thúy committed
59

Giang Tran committed
60 61 62 63 64
export const getDetailUser = async (body) =>
  GetData(url.urlGetDetailUser, body)
    .then((res) => res)
    .catch((err) => err);

Nguyễn Thị Thúy committed
65 66 67 68
export const getNewestVersionInfo = async (body) =>
  GetData(url.urlGetNewestVersionInfo, body)
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
69 70 71 72 73

export const changeAvatart = async (body) =>
  PostFormData(url.urlChangeAvatar, body)
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
74 75 76 77 78 79

export const getOTPApiSmartOTP = async (body) =>
  PostLogin(url.urlGetSmartOTP, body)
    .then((res) => res)
    .catch((err) => err);

Giang Tran committed
80
export const verifyStoreOTPApiSmart = async (body) =>
Giang Tran committed
81 82 83
  PostData(url.urlStoreOTPSmart, body)
    .then((res) => res)
    .catch((err) => err);
Giang Tran committed
84 85 86 87 88 89 90 91 92 93

export const verifyOTPApiSmart = async (body) =>
  PostData(url.urlVerufySmartOTP, body)
    .then((res) => res)
    .catch((err) => err);

export const updateOTPApiSmart = async (body) =>
  PostData(url.urlUpdateSmartOTP, body)
    .then((res) => res)
    .catch((err) => err);
94 95 96 97 98

export const verifyPassword = async (body) =>
  PostData(url.urlVerifyPassword, body)
    .then((res) => res)
    .catch((err) => err);