Quellcode durchsuchen

fix getActiveProposals types

Joystream Stats vor 2 Jahren
Ursprung
Commit
ae6267ca5f
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  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,