Clean isManager
This commit is contained in:
parent
db13a49ba9
commit
a042a59276
|
@ -504,7 +504,7 @@ api.post("/users/createBlank", async (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
api.post("/users/changeManagerStatus", async (req, res) => {
|
api.post("/users/changeManagerStatus", async (req, res) => {
|
||||||
if (!await isManager(req.session)) {
|
if (!(await isManager(req.session))) {
|
||||||
res.json({"status": "error", "data": "Not authorized"});
|
res.json({"status": "error", "data": "Not authorized"});
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -556,10 +556,4 @@ function editUser(email, user) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function userIsManager(userId) {
|
|
||||||
getUser(userId)
|
|
||||||
.then(user => { return user.isManager; })
|
|
||||||
.catch(err => { console.log(err); return false; });
|
|
||||||
}
|
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
Loading…
Reference in New Issue