summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-16 10:40:53 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-16 10:40:53 +0900
commite11f547308af19c5ae54a906cec795e65f407b8c (patch)
tree2fca485dcea95dfb724402d41009b2f155be5f32 /src/server/api/endpoints
parent2.42.0 (diff)
downloadsharkey-e11f547308af19c5ae54a906cec795e65f407b8c.tar.gz
sharkey-e11f547308af19c5ae54a906cec795e65f407b8c.tar.bz2
sharkey-e11f547308af19c5ae54a906cec795e65f407b8c.zip
#1715
Diffstat (limited to 'src/server/api/endpoints')
-rw-r--r--src/server/api/endpoints/stats.ts24
1 files changed, 4 insertions, 20 deletions
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);
});