Sfoglia il codice sorgente

fix getActiveProposals types

Joystream Stats 2 anni fa
parent
commit
ae6267ca5f
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  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,