fix: move interleaved export below imports, add await to countUsersByRole

This commit is contained in:
Dustin Healy 2026-03-26 17:11:14 -07:00
parent e9572854ef
commit 2a4cbfa41a
2 changed files with 2 additions and 3 deletions

View file

@ -1,10 +1,9 @@
import { createSessionMethods, DEFAULT_REFRESH_TOKEN_EXPIRY, type SessionMethods } from './session';
import { createTokenMethods, type TokenMethods } from './token';
import { createRoleMethods, RoleConflictError, type RoleMethods, type RoleDeps } from './role';
export { RoleConflictError };
import { createUserMethods, DEFAULT_SESSION_EXPIRY, type UserMethods } from './user';
export { DEFAULT_REFRESH_TOKEN_EXPIRY, DEFAULT_SESSION_EXPIRY };
export { RoleConflictError, DEFAULT_REFRESH_TOKEN_EXPIRY, DEFAULT_SESSION_EXPIRY };
import { createKeyMethods, type KeyMethods } from './key';
import { createFileMethods, type FileMethods } from './file';
/* Memories */

View file

@ -438,7 +438,7 @@ export function createRoleMethods(mongoose: typeof import('mongoose'), deps: Rol
}
async function countUsersByRole(roleName: string): Promise<number> {
return getUserModel().countDocuments({ role: roleName });
return await getUserModel().countDocuments({ role: roleName });
}
return {