-
Notifications
You must be signed in to change notification settings - Fork 1
/
appConstants.js
70 lines (66 loc) · 2.29 KB
/
appConstants.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const BASE_URL = `https://mighty-ravine-63394.herokuapp.com/`;
// const BASE_URL = `http://localhost:8000/`;
const DOMAIN = `https://frontend-three-kappa.vercel.app/`;
// const DOMAIN = `http://localhost:3000`;
// others
const COOKIE_NAME = "token";
// CHATBOT endpoint
const CHATBOT = `https://titanreadchatbot.herokuapp.com/webhooks/rest/webhook`;
// urls to fetch and post
const UPLOADS = `${BASE_URL}uploads`;
const SIGNUP = `${BASE_URL}api/user/register`;
const SIGNIN = `${BASE_URL}api/user/login`;
const GOOGLESIGNIN = `${BASE_URL}api/user/googleSignin`;
const SIGNOUT = `${BASE_URL}api/user/logout`;
const ARTICLE_CREATE = `${BASE_URL}api/article/create`;
const FETCH_ARTICLES = `${BASE_URL}api/article`;
const FETCH_CATEGORY_ARTICLES = (category) =>
`${BASE_URL}api/article/category/${category}`;
const FETCH_PARTICULAR_ARTILCE = (slug) => `${BASE_URL}api/article/one/${slug}`;
const FETCH_TYPE = `Single`;
const FETCH_HELP_ALL = `${BASE_URL}api/request`;
const CREATE_REQUEST = `${BASE_URL}api/request/create`;
const SINGLE_REQUEST = (slug) => `${BASE_URL}api/request/one/${slug}`;
const SUGGEST_ARTICLE_REQUEST = (slug) =>
`${BASE_URL}api/request/suggest/one/${slug}`;
const APPROVE_REQUEST = (slug) => `${BASE_URL}api/request/close/one/${slug}`;
const TOGGLE_FAVOURITE = (slug) => `${BASE_URL}api/article/favourite/${slug}`;
const TOGGLE_LIKE = (slug) => `${BASE_URL}api/article/react/${slug}`;
const FETCH_FAVOURITES = (username) =>
`${BASE_URL}api/user/favourites/${username}`;
const SEARCH_ARTICLES = (search) =>
`${BASE_URL}api/article/search?search=${search}`;
const ARTICLES_BY_SPECIFIC_USER = (username) =>
`${BASE_URL}api/user/articles/${username}`;
const EMAIL_VERIFICATION = (username) =>
`${BASE_URL}api/user/emailverification/${username}`;
const RECOVER_PASSWORD = (username) =>
`${BASE_URL}api/user/recoverpassword/${username}`;
export {
UPLOADS,
CHATBOT,
SIGNIN,
GOOGLESIGNIN,
SIGNUP,
ARTICLE_CREATE,
COOKIE_NAME,
BASE_URL,
DOMAIN,
SIGNOUT,
FETCH_ARTICLES,
FETCH_CATEGORY_ARTICLES,
FETCH_PARTICULAR_ARTILCE,
FETCH_TYPE,
FETCH_HELP_ALL,
CREATE_REQUEST,
SINGLE_REQUEST,
SUGGEST_ARTICLE_REQUEST,
APPROVE_REQUEST,
TOGGLE_FAVOURITE,
TOGGLE_LIKE,
FETCH_FAVOURITES,
SEARCH_ARTICLES,
ARTICLES_BY_SPECIFIC_USER,
EMAIL_VERIFICATION,
RECOVER_PASSWORD,
};