3
0
Prechádzať zdrojové kódy

api: use MemberId instead of number

Joystream Stats 2 rokov pred
rodič
commit
0d5b8b74eb
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      api.ts

+ 3 - 3
api.ts

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