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:
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
@@ -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,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user