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 <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>
This commit is contained in:
Joe Au-Yeung
2025-09-13 08:35:23 +01:00
committed by GitHub
co-authored by joe@cal.com <j.auyeung419@gmail.com> joe@cal.com <j.auyeung419@gmail.com> Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent cf07621de7
commit d7397d4563
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -96,6 +96,16 @@ export const getEventTypesFromDB = async (id: number) => {
parent: {
select: {
teamId: true,
team: {
select: {
hideBranding: true,
parent: {
select: {
hideBranding: true,
},
},
},
},
},
},
},
@@ -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,
}),