Skip to content

Commit

Permalink
Merge pull request #465 from DIVD-NL/463-make-sure-the-team-lead-is-s…
Browse files Browse the repository at this point in the history
…hown-in-front

463 - Make sure our Head of IT Services gets put in front
  • Loading branch information
MagicLegend authored Jul 29, 2024
2 parents cd5d89c + 25d561f commit 7864cdf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts/generate_teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,24 @@ const fetchTeamsAndMembers = async () => {
if (!existingTeam.members) existingTeam.members = [];

const existingMemberSlugs = new Set(existingTeam.members?.map((member) => member.split('/').pop()));
let foundWinko = false;

fetchedTeam.members.forEach((member) => {
const memberSlug = `/who-we-are/team/people/${member.slug}`;
if (!existingMemberSlugs.has(member.slug)) {
existingTeam.members.push(memberSlug);
if (member.slug === 'winko') {
foundWinko = memberSlug; // Store the slug if it is "winko"
} else {
existingTeam.members.push(memberSlug);
}
}
});

// Move "winko" to the front if found
if (foundWinko) {
// eslint-disable-next-line no-param-reassign
existingTeam.members = [foundWinko, ...existingTeam.members];
}
}
});

Expand Down

0 comments on commit 7864cdf

Please sign in to comment.