From f8e9d1ba02ff63724f0d24a71c60333cc32f8407 Mon Sep 17 00:00:00 2001 From: Oleg Kalenik Date: Mon, 17 Jan 2022 11:40:17 +0200 Subject: [PATCH] *fixed vote rate growth calculation --- apps/api/src/governance/governance.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/api/src/governance/governance.service.ts b/apps/api/src/governance/governance.service.ts index b67cb02..3d6a110 100644 --- a/apps/api/src/governance/governance.service.ts +++ b/apps/api/src/governance/governance.service.ts @@ -88,6 +88,8 @@ export class GovernanceService { }), ]); + const voteRate = getRate(proposalsApprovedCount, proposalsCount); + return { proposals: { count: proposalsCount, @@ -104,10 +106,10 @@ export class GovernanceService { members: proposalsMemberCount, }, voteRate: { - count: getRate(proposalsApprovedCount, proposalsCount), + count: voteRate, growth: getGrowth( - proposalsApprovedCount / proposalsCount, - dayAgoProposalsApprovedCount / dayAgoProposalsCount, + voteRate, + getRate(dayAgoProposalsApprovedCount, dayAgoProposalsCount), ), }, };