From 51e852f671035a5f03aaaa4c4524c6f04bacfe19 Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Tue, 14 Apr 2026 08:29:10 -0300 Subject: [PATCH] refactor: narrow user fields returned by dynamic event endpoint (#28875) --- .../features/eventtypes/lib/getPublicEvent.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/features/eventtypes/lib/getPublicEvent.ts b/packages/features/eventtypes/lib/getPublicEvent.ts index 2d106e599a..d587b1f361 100644 --- a/packages/features/eventtypes/lib/getPublicEvent.ts +++ b/packages/features/eventtypes/lib/getPublicEvent.ts @@ -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,