瀏覽代碼

fix getActiveProposals types

Joystream Stats 2 年之前
父節點
當前提交
ae6267ca5f
共有 1 個文件被更改,包括 4 次插入2 次删除
  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,