Prioritise organizer to be the fixed, not lucky (round robin) user (#7317)
This commit is contained in:
parent
1dbdb8a4d4
commit
8a6a7524cc
|
@ -474,7 +474,8 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) {
|
|||
) {
|
||||
throw new Error("Some users are unavailable for booking.");
|
||||
}
|
||||
users = [...luckyUsers, ...availableUsers.filter((user) => user.isFixed)];
|
||||
// Pushing fixed user before the luckyUser guarantees the (first) fixed user as the organizer.
|
||||
users = [...availableUsers.filter((user) => user.isFixed), ...luckyUsers];
|
||||
}
|
||||
|
||||
const rainbowAppData = getEventTypeAppData(eventType, "rainbow") || {};
|
||||
|
|
Loading…
Reference in New Issue
Block a user