Browse Source

api: use MemberId instead of number

Joystream Stats 2 years ago
parent
commit
0d5b8b74eb
1 changed files with 3 additions and 3 deletions
  1. 3 3
      api.ts

+ 3 - 3
api.ts

@@ -488,12 +488,12 @@ const formatProposalMessage = (
 export const getProposalVotes = async (
 export const getProposalVotes = async (
   api: ApiPromise,
   api: ApiPromise,
   id: ProposalId | number
   id: ProposalId | number
-): Promise<{ memberId: number; vote: string }[]> => {
-  let votes: { memberId: number; vote: string }[] = [];
+): Promise<{ memberId: MemberId; vote: string }[]> => {
+  let votes: { memberId: MemberId; vote: string }[] = [];
   const entries =
   const entries =
     await api.query.proposalsEngine.voteExistsByProposalByVoter.entries(id);
     await api.query.proposalsEngine.voteExistsByProposalByVoter.entries(id);
   entries.forEach((entry: any) => {
   entries.forEach((entry: any) => {
-    const memberId = entry[0].args[1].toJSON();
+    const memberId = entry[0].args[1] as MemberId;
     const vote = entry[1].toString();
     const vote = entry[1].toString();
     votes.push({ memberId, vote });
     votes.push({ memberId, vote });
   });
   });