chore: Remove users from getSchedule return (#11940)
parent
33bef6acd0
commit
0fd6bed813
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue