Explorar o código

change findAll to countList

Seiya Tashiro %!s(int64=7) %!d(string=hai) anos
pai
achega
7b77e1f717
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      src/server/routes/admin.js

+ 1 - 2
src/server/routes/admin.js

@@ -469,8 +469,7 @@ module.exports = function(crowi, app) {
 
   actions.user = {};
   actions.user.index = async function(req, res) {
-    const findAllUsers = await User.findAllUsers({status: User.statusActivate});
-    const activeUsers = findAllUsers.length;
+    const activeUsers = await User.countListByStatus(User.STATUS_ACTIVE);
     const Config = crowi.model('Config');
     const userUpperLimit = Config.userUpperLimit(crowi);
     const isUserCountExceedsUpperLimit = await User.isUserCountExceedsUpperLimit();