Skip to content

Commit d7397d4

Browse files
fix: managed event types inherit team hideBranding setting (calcom#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 <j.auyeung419@gmail.com> * chore: update yarn.lock dependencies Co-Authored-By: joe@cal.com <j.auyeung419@gmail.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>
1 parent cf07621 commit d7397d4

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

apps/web/lib/booking.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ export const getEventTypesFromDB = async (id: number) => {
9696
parent: {
9797
select: {
9898
teamId: true,
99+
team: {
100+
select: {
101+
hideBranding: true,
102+
parent: {
103+
select: {
104+
hideBranding: true,
105+
},
106+
},
107+
},
108+
},
99109
},
100110
},
101111
},

apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
240240
? true
241241
: await shouldHideBrandingForEvent({
242242
eventTypeId: eventType.id,
243-
team: eventType.team,
243+
team: eventType?.parent?.team ?? eventType?.team,
244244
owner: eventType.users[0] ?? null,
245245
organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null,
246246
}),

0 commit comments

Comments
 (0)