Return admin account status on check

This commit is contained in:
Alex Holliday committed 2024-07-02 10:45:38 -07:00
1 parent d7d6effdda
commit ec63281202
4 files changed
+13 -2

No files matched your search

+4 -1
View File
@@ -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;
}