refactor: narrow user fields returned by dynamic event endpoint (#28875)

This commit is contained in:
Pedro Castro authored and GitHub committed 2026-04-14 08:29:10 -03:00
1 parent 053fb56b79
commit 51e852f671
1 file changed
+15 -5
@@ -345,16 +345,26 @@ export const getPublicEvent = async (
bookingFields: getBookingFieldsWithSystemFields({ ...defaultEvent, disableBookingTitle }),
restrictionScheduleId: null,
useBookerTimezone: false,
// Clears meta data since we don't want to send this in the public api.
// Only return fields consumed by the booker.
subsetOfUsers: users.map((user) => ({
...user,
metadata: undefined,
name: user.name,
username: user.username,
avatarUrl: user.avatarUrl,
weekStart: user.weekStart,
brandColor: user.brandColor,
darkBrandColor: user.darkBrandColor,
profile: user.profile,
bookerUrl: getBookerBaseUrlSync(user.profile?.organization?.slug ?? null),
})),
users: fetchAllUsers
? users.map((user) => ({
...user,
metadata: undefined,
name: user.name,
username: user.username,
avatarUrl: user.avatarUrl,
weekStart: user.weekStart,
brandColor: user.brandColor,
darkBrandColor: user.darkBrandColor,
profile: user.profile,
bookerUrl: getBookerBaseUrlSync(user.profile?.organization?.slug ?? null),
}))
: undefined,