Refactor getUserData function to use async/await
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-29 09:46:27 +01:00
parent 8a12843880
commit 48743b9831

View File

@@ -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');