From af803ce0e63f9e20e4db1e0e0d54bd2bdc48e446 Mon Sep 17 00:00:00 2001 From: Vasily Belolapotkov Date: Thu, 3 Oct 2019 12:54:04 +0300 Subject: [PATCH] fix invites count calculation for admin dashboard --- backend/src/schema/resolvers/statistics.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/schema/resolvers/statistics.js b/backend/src/schema/resolvers/statistics.js index 466c1ef70..cae29f40c 100644 --- a/backend/src/schema/resolvers/statistics.js +++ b/backend/src/schema/resolvers/statistics.js @@ -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() }