Skip to content

Commit

Permalink
*fixed vote rate growth calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
okalenyk committed Jan 17, 2022
1 parent efd11f3 commit f8e9d1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/api/src/governance/governance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export class GovernanceService {
}),
]);

const voteRate = getRate(proposalsApprovedCount, proposalsCount);

return {
proposals: {
count: proposalsCount,
Expand All @@ -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),
),
},
};
Expand Down

0 comments on commit f8e9d1b

Please sign in to comment.