Refactor getUserData function to use async/await
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -5,7 +5,7 @@ const { getUserData } = require('../Middlewares/watcherMiddleware');
|
|||||||
const filePath = path.join(__dirname, '../user.json');
|
const filePath = path.join(__dirname, '../user.json');
|
||||||
|
|
||||||
async function checkUserExistsAD(req, res, next) {
|
async function checkUserExistsAD(req, res, next) {
|
||||||
let userData = getUserData();
|
let userData = await getUserData();
|
||||||
|
|
||||||
if (!req.user || (!req.user.name && !req.user.id)) {
|
if (!req.user || (!req.user.name && !req.user.id)) {
|
||||||
return res.status(500).send('Internal Server Error');
|
return res.status(500).send('Internal Server Error');
|
||||||
|
|||||||
Reference in New Issue
Block a user