From 90bf15a73f4385647eb233f80634f3ba92fdc77d Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Wed, 11 Oct 2023 09:05:47 -0500 Subject: [PATCH] fix: filter out orgs from GitHub list import (#1866) --- pages/hub/lists/new.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/hub/lists/new.tsx b/pages/hub/lists/new.tsx index a747a0baf7..1c9c452f67 100644 --- a/pages/hub/lists/new.tsx +++ b/pages/hub/lists/new.tsx @@ -19,12 +19,13 @@ import { useToast } from "lib/hooks/useToast"; interface CreateListPayload { name: string; is_public: boolean; - contributors: GhFollowing[]; + contributors: { id: number; login: string }[]; } interface GhFollowing { id: number; login: string; + type: string; } const CreateListPage = () => { @@ -110,7 +111,9 @@ const CreateListPage = () => { return; } - const following = getFollowingRandom(followingList, 10); + // Filter out orgs + const contributorFollowingList = followingList.filter((contributor) => contributor.type === "User"); + const following = getFollowingRandom(contributorFollowingList, 10); const response = await createList({ name,