move checksuperadmin

This commit is contained in:
Alex Holliday committed 2025-07-23 11:46:59 -07:00
1 parent 812cff0fd9
commit 74fd20cfa8
3 files changed
+30 -162

No files matched your search

+21 -1
View File
@@ -8,6 +8,14 @@ import ServiceRegistry from "../../../service/serviceRegistry.js";
import StringService from "../../../service/stringService.js";
const SERVICE_NAME = "userModule";
const checkSuperadmin = async () => {
const superAdmin = await UserModel.findOne({ role: "superadmin" });
if (superAdmin !== null) {
return true;
}
return false;
};
/**
* Insert a User
* @async
@@ -238,4 +246,16 @@ const editUserById = async (userId, user) => {
}
};
export { insertUser, getUserByEmail, updateUser, deleteUser, deleteTeam, deleteAllOtherUsers, getAllUsers, logoutUser, getUserById, editUserById };
export {
checkSuperadmin,
insertUser,
getUserByEmail,
updateUser,
deleteUser,
deleteTeam,
deleteAllOtherUsers,
getAllUsers,
logoutUser,
getUserById,
editUserById,
};