Ver código fonte

fix getActiveProposals types

Joystream Stats 2 anos atrás
pai
commit
ae6267ca5f
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      api.ts

+ 4 - 2
api.ts

@@ -392,10 +392,12 @@ export const getPost = async (api: ApiPromise, id: number): Promise<Post> =>
   (await api.query.forum.postById(id)) as Post;
 
 // proposals
-export const getActiveProposals = async (api: ApiPromise): Promise<number[]> =>
+export const getActiveProposals = async (
+  api: ApiPromise
+): Promise<ProposalId[]> =>
   api.query.proposalsEngine.activeProposalIds
     .keys()
-    .then((ids) => ids.map(([key]) => key));
+    .then((ids) => ids.map(([key]) => key as unknown as ProposalId));
 
 export const getProposalCount = async (
   api: ApiPromise,