Check for superadmin as opposed to admin

This commit is contained in:
Alex Holliday committed 2024-08-26 09:46:23 -07:00
1 parent 4b2973e308
commit ef02bd8078
4 files changed
+10 -10

No files matched your search

+3 -3
View File
@@ -15,9 +15,9 @@ const connect = async () => {
}
};
const checkAdmin = async (req, res) => {
const checkSuperadmin = async (req, res) => {
try {
const admin = await UserModel.findOne({ role: "admin" });
const admin = await UserModel.findOne({ role: "superadmin" });
if (admin !== null) {
return true;
}
@@ -141,7 +141,7 @@ module.exports = {
requestRecoveryToken,
validateRecoveryToken,
resetPassword,
checkAdmin,
checkSuperadmin,
getAllMonitors,
getMonitorStatsById,
getMonitorById,