-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpermissions.js
51 lines (40 loc) · 1.55 KB
/
permissions.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
/*export const signInPermissions = function() {
const account_status = getAccountStatus();
let account_type = account_status.data.account_type
if (account_type == "user" || account_type == "private") {
document.getElementById("sign_in").style.visibility = "hidden";
document.getElementById("sign_out").style.visibility = "show";
document.getElementById("sign_in").replaceWith(document.getElementById("sign_out"));
lactationData.forEach(room => {
document.getElementById(room.id+"AddCommentButton").style.visbility = "show";
});
} else {
document.getElementById("sign_in").style.visibility = "show";
document.getElementById("sign_out").style.visibility = "hidden";
lactationData.forEach(room => {
document.getElementById(room.id+"AddCommentButton").style.visbility = "hidden";
});
}
}
export const getAccountStatus = async function() {
const response = await axios({
method: "get",
url: "http://localhost:3000/account/status",
});
return response;
let r = axios.get('http://localhost:3000/account/status',
{
headers: {
//jwt is the jwt from logging in
"Authorization": "Bearer " + jwt
},
});
r.then(response => {
console.log(response.data);
}).catch(error => {
console.log(error);
});
}
$(function() {
signInPermissions();
})*/