Return admin account status on check
This commit is contained in:
1 parent
d7d6effdda
commit
ec63281202
4 files changed
+13
-2
No files matched your search
@@ -166,7 +166,10 @@ const resetPassword = async (req, res) => {
|
||||
const checkAdmin = async (req, res) => {
|
||||
try {
|
||||
const admin = await UserModel.findOne({ role: "admin" });
|
||||
console.log(admin);
|
||||
if (admin !== null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user