Add route and controller
This commit is contained in:
1 parent
898738e287
commit
d7d6effdda
3 files changed
+31
No files matched your search
@@ -151,6 +151,24 @@ const userEditController = async (req, res, next) => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks to see if an admin account exists
|
||||
* @async
|
||||
* @param {Express.Request} req
|
||||
* @param {Express.Response} res
|
||||
* @returns {Promise<Express.Response>}
|
||||
*/
|
||||
|
||||
const checkAdminController = async (req, res) => {
|
||||
try {
|
||||
await req.db.checkAdmin(req, res);
|
||||
} catch (error) {
|
||||
error.service = SERVICE_NAME;
|
||||
next(error);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a recovery token
|
||||
* @async
|
||||
@@ -238,6 +256,7 @@ module.exports = {
|
||||
registerController,
|
||||
loginController,
|
||||
userEditController,
|
||||
checkAdminController,
|
||||
recoveryRequestController,
|
||||
validateRecoveryTokenController,
|
||||
resetPasswordController,
|
||||
|
||||
Reference in new issue
Block a user