Skip to content

Commit

Permalink
Merge pull request #95 from near-daos/hotfix/number-of-members
Browse files Browse the repository at this point in the history
hotfix(number of members): fixed number of members aggregation
  • Loading branch information
vhorin-mp authored Jan 6, 2022
2 parents 9a4c9ae + e4aaf1d commit ae37d87
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libs/transaction-handler/src/types/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ export function castDaoPolicy({ daoId, daoPolicy }) {
)
.map(({ accountIds }) => accountIds)
.reduce((acc, val) => acc.concat(val), []);
const numberOfMembers = roles
.filter((role) => role.kind === RoleKindType.Group)
.map((group) => group.accountIds)
.flat().length;
const numberOfMembers = [
...new Set(
roles
.filter((role) => role.kind === RoleKindType.Group)
.map((group) => group.accountIds)
.flat(),
),
].length;

return {
council,
Expand Down

0 comments on commit ae37d87

Please sign in to comment.