From dc98cd6010409955b23b24d1ca8b22ec395a0fdc Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 6 Sep 2020 18:48:22 +0300 Subject: [PATCH] Workaround typescript issue with list responses being any. --- src/Collections/CollectionMembers.tsx | 5 ++--- src/Collections/Invitations.tsx | 5 ++--- src/Pim/ItemChangeHistory.tsx | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Collections/CollectionMembers.tsx b/src/Collections/CollectionMembers.tsx index dc08448..3e18368 100644 --- a/src/Collections/CollectionMembers.tsx +++ b/src/Collections/CollectionMembers.tsx @@ -46,9 +46,8 @@ export default function CollectionMembers(props: PropsType) { let iterator: string | null = null; let done = false; while (!done) { - // FIXME: shouldn't be any - const members: any = await memberManager.list({ iterator, limit: 30 }); - iterator = members.iterator; + const members = await memberManager.list({ iterator, limit: 30 }); + iterator = members.iterator as string; done = members.done; for (const member of members.data) { diff --git a/src/Collections/Invitations.tsx b/src/Collections/Invitations.tsx index 81d1805..5c88156 100644 --- a/src/Collections/Invitations.tsx +++ b/src/Collections/Invitations.tsx @@ -26,9 +26,8 @@ async function loadInvitations(etebase: Etebase.Account) { let iterator: string | null = null; let done = false; while (!done) { - // FIXME: shouldn't be any - const invitations: any = await invitationManager.listIncoming({ iterator, limit: 30 }); - iterator = invitations.iterator; + const invitations = await invitationManager.listIncoming({ iterator, limit: 30 }); + iterator = invitations.iterator as string; done = invitations.done; ret.push(...invitations.data); diff --git a/src/Pim/ItemChangeHistory.tsx b/src/Pim/ItemChangeHistory.tsx index aaa69ac..6354727 100644 --- a/src/Pim/ItemChangeHistory.tsx +++ b/src/Pim/ItemChangeHistory.tsx @@ -31,9 +31,8 @@ async function loadRevisions(etebase: Etebase.Account, col: Etebase.Collection, let iterator: string | null = null; let done = false; while (!done) { - // FIXME: shouldn't be any - const revisions: any = await itemManager.itemRevisions(item, { iterator, limit: 30 }); - iterator = revisions.iterator; + const revisions = await itemManager.itemRevisions(item, { iterator, limit: 30 }); + iterator = revisions.iterator as string; done = revisions.done; for (const item of revisions.data) {