From d7397d456337f5841e4ff34e916f9c2fc219fb0a Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Sat, 13 Sep 2025 03:35:23 -0400 Subject: [PATCH] fix: managed event types inherit team hideBranding setting (#23562) * fix: managed event types inherit team hideBranding setting - Add getParentTeamForBranding helper to query parent team data - Update shouldHideBrandingForEvent to use parent team when eventType.team is null - Ensures CTA 'create your own booking link with Cal' respects team branding settings - Follows existing pattern used by eventType.team?.id ?? eventType.parent?.teamId Co-Authored-By: joe@cal.com * chore: update yarn.lock dependencies Co-Authored-By: joe@cal.com * Get parent event type team branding * Use data from getEventTypeFromDB * Undo yarn.lock changes * Undo yarn.lock changes from latest main * Address code commit --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- apps/web/lib/booking.ts | 10 ++++++++++ .../views/bookings-single-view.getServerSideProps.tsx | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/web/lib/booking.ts b/apps/web/lib/booking.ts index 64a21acf89..3c61015f0f 100644 --- a/apps/web/lib/booking.ts +++ b/apps/web/lib/booking.ts @@ -96,6 +96,16 @@ export const getEventTypesFromDB = async (id: number) => { parent: { select: { teamId: true, + team: { + select: { + hideBranding: true, + parent: { + select: { + hideBranding: true, + }, + }, + }, + }, }, }, }, diff --git a/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx b/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx index 98530ff041..df102f6974 100644 --- a/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx +++ b/apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx @@ -240,7 +240,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { ? true : await shouldHideBrandingForEvent({ eventTypeId: eventType.id, - team: eventType.team, + team: eventType?.parent?.team ?? eventType?.team, owner: eventType.users[0] ?? null, organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null, }),