This commit is contained in:
syuilo
2018-06-16 10:40:53 +09:00
parent f164661ef2
commit e11f547308
8 changed files with 102 additions and 22 deletions

View File

@ -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);
});