mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -05:00
13 lines
347 B
TypeScript
13 lines
347 B
TypeScript
|
import { countUsers } from '@/queries/user';
|
||
|
|
||
|
import { AuthedRouter } from './types';
|
||
|
|
||
|
export default function dashboardRoutes<T extends AuthedRouter>(router: T) {
|
||
|
router.get('/dashboard/users/total', async (ctx, next) => {
|
||
|
const { count: totalUserCount } = await countUsers();
|
||
|
ctx.body = { totalUserCount };
|
||
|
|
||
|
return next();
|
||
|
});
|
||
|
}
|