Merge pull request #1806 from Human-Connection/1633-admin-stats

fix invites count calculation for admin dashboard
This commit is contained in:
Robert Schäfer 2019-10-03 23:51:17 +02:00 committed by GitHub
commit 48fdf956c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ export default {
countPosts: 'Post',
countComments: 'Comment',
countNotifications: 'NOTIFIED',
countInvites: 'InvitationCode',
countEmails: 'EmailAddress',
countFollows: 'FOLLOWS',
countShouts: 'SHOUTED',
}
@ -28,6 +28,11 @@ export default {
const stat = statistics[mapping[key]]
response[key] = stat ? stat.toNumber() : 0
})
/*
* Note: invites count is calculated this way because invitation codes are not in use yet
*/
response.countInvites = response.countEmails - response.countUsers
} finally {
session.close()
}