From a042a592762dfa41449693776a4bf19a96f4a50d Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sun, 24 Apr 2022 13:41:55 +0200 Subject: [PATCH] Clean isManager --- src/server/index.js | 2 +- src/server/tmdb.js | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index b36df84..b8ccb1f 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -504,7 +504,7 @@ api.post("/users/createBlank", 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"}); return } diff --git a/src/server/tmdb.js b/src/server/tmdb.js index c825d1c..93b71e5 100644 --- a/src/server/tmdb.js +++ b/src/server/tmdb.js @@ -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 \ No newline at end of file