-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutils.js
75 lines (69 loc) · 1.79 KB
/
utils.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
71
72
73
const axios = require('axios');
const {API_URL, HASURA_ADMIN_SECRET} = require('./config');
module.exports = {
addTrainee: async function (data) {
return axios({
method: 'post',
url: `${API_URL}/addTrainee`,
data: JSON.stringify(data),
headers: {
'x-hasura-admin-secret': HASURA_ADMIN_SECRET,
'Content-Type': 'application/json',
}
}).then((response) => {
return response
})
},
addIti: async function (data) {
return axios({
method: 'post',
url: `${API_URL}/addIti`,
data: JSON.stringify(data),
headers: {
'x-hasura-admin-secret': HASURA_ADMIN_SECRET,
'Content-Type': 'application/json',
}
}).then((response) => {
return response
})
},
addIndustry: async function (data) {
return axios({
method: 'post',
url: `${API_URL}/addIndustry`,
data: JSON.stringify(data),
headers: {
'x-hasura-admin-secret': HASURA_ADMIN_SECRET,
'Content-Type': 'application/json',
}
}).then((response) => {
return response
})
},
getIndustryByName: async function (data) {
return axios({
method: 'get',
url: `${API_URL}/getIndustryByName`,
data: JSON.stringify(data),
headers: {
'x-hasura-admin-secret': HASURA_ADMIN_SECRET,
'Content-Type': 'application/json',
}
}).then((response) => {
return response
})
},
addIndustrySchedule: async function (data) {
return axios({
method: 'post',
url: `${API_URL}/addIndustrySchedule`,
data: JSON.stringify(data),
headers: {
'x-hasura-admin-secret': HASURA_ADMIN_SECRET,
'Content-Type': 'application/json',
}
}).then((response) => {
return response
})
}
}