Fix weekly randomizer when standup channel have less than 4 people

pull/2549/head
Jérémy Rialland 2023-04-05 12:41:58 +02:00 committed by Jérémy Rialland
parent 4a741d03d3
commit fb689298c7
1 changed files with 4 additions and 0 deletions

View File

@ -42,6 +42,10 @@ const standupMembers = await Promise.all(
)
)
while (standupMembers.length > 0 && standupMembers.length < 4) {
standupMembers.push(...standupMembers)
}
const shuffleMembers = shuffleArray(standupMembers)
await mongo.setWeeklyTeamOrder(shuffleMembers.map(({ id }) => id))