mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-27 05:36:44 -06:00
26 lines
493 B
TypeScript
26 lines
493 B
TypeScript
import Note from '../../../models/note';
|
|
import User from '../../../models/user';
|
|
|
|
/**
|
|
* Get the misskey's statistics
|
|
*/
|
|
module.exports = params => new Promise(async (res, rej) => {
|
|
const notesCount = await Note.count();
|
|
|
|
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
|
|
});
|
|
});
|