chore: Remove users from getSchedule return (#11940)

fix/offset-adds-to-interval
Alex van Andel 2023-10-17 12:29:21 +01:00 committed by GitHub
parent 33bef6acd0
commit 0fd6bed813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 8 deletions

View File

@ -567,7 +567,7 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
const computedAvailableSlots = availableTimeSlots.reduce(
(
r: Record<string, { time: string; users: string[]; attendees?: number; bookingUid?: string }[]>,
r: Record<string, { time: string; attendees?: number; bookingUid?: string }[]>,
{ time, ...passThroughProps }
) => {
// TODO: Adds unit tests to prevent regressions in getSchedule (try multiple timezones)
@ -580,13 +580,6 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
r[dateString].push({
...passThroughProps,
time: time.toISOString(),
users: (eventType.hosts
? eventType.hosts.map((hostUserWithCredentials) => {
const { user } = hostUserWithCredentials;
return user;
})
: eventType.users
).map((user) => user.username || ""),
// Conditionally add the attendees and booking id to slots object if there is already a booking during that time
...(currentSeats?.some((booking) => booking.startTime.toISOString() === time.toISOString()) && {
attendees: