Skip to content

Commit

Permalink
fix: filter out orgs from GitHub list import (#1866)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored Oct 11, 2023
1 parent 9f16f3b commit 90bf15a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pages/hub/lists/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 90bf15a

Please sign in to comment.