From e11f547308af19c5ae54a906cec795e65f407b8c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 16 Jun 2018 10:40:53 +0900 Subject: #1715 --- src/server/api/endpoints/stats.ts | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src/server/api/endpoints') diff --git a/src/server/api/endpoints/stats.ts b/src/server/api/endpoints/stats.ts index d1e17651f2..74ab6ba945 100644 --- a/src/server/api/endpoints/stats.ts +++ b/src/server/api/endpoints/stats.ts @@ -1,26 +1,10 @@ -import Note from '../../../models/note'; -import User from '../../../models/user'; +import Meta from '../../../models/meta'; /** * Get the misskey's statistics */ -module.exports = params => new Promise(async (res, rej) => { - const notesCount = await Note.count(); +module.exports = () => new Promise(async (res, rej) => { + const meta = await Meta.findOne(); - const usersCount = await User.count(); - - const originalNotesCount = await Note.count({ - '_user.host': null - }); - - const originalUsersCount = await User.count({ - host: null - }); - - res({ - notesCount, - usersCount, - originalNotesCount, - originalUsersCount - }); + res(meta.stats); }); -- cgit v1.2.3-freya