Skip to content

Commit

Permalink
Merge pull request #90 from Louis-htmlcss/fix-contrib
Browse files Browse the repository at this point in the history
refactor: Improve filtering of team contributors
  • Loading branch information
tryon-dev committed Aug 28, 2024
2 parents d2a8cc9 + bd1cb8d commit c01e9ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/GetRessources/GetContribs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export async function getContributors (): Promise<Contributor[]> {
try {
const { data: allContributors } = await axios.get<Contributor[]>("https://api.github.com/repos/PapillonApp/Papillon/contributors");

const teamGithubUrls = new Set(
const teamGithubUsernames = new Set(
teams
.filter((team): team is { name: string; description: string; link: string; ppimage: string; github: string } => Boolean(team.github))
.map(({ github }) => github?.toLowerCase() ?? "")
.map(({ github }) => github.split("/").pop()?.toLowerCase() ?? "")
);

return allContributors.filter(({ html_url }) =>
!teamGithubUrls.has(new URL(html_url).hostname.replace("www.", ""))
return allContributors.filter(({ login }) =>
!teamGithubUsernames.has(login.toLowerCase())
);
} catch (error) {
console.error("Erreur lors de la récupération des contributeurs:", error);
Expand Down

0 comments on commit c01e9ee

Please sign in to comment.