fix: cascade organization hideBranding setting to user and team events (#21703)

- Add utility function for cascading hideBranding logic
- Update all getServerSideProps files to check organization hideBranding as fallback
- Ensure team queries include parent hideBranding data
- Fix hideBranding not working for organization members and teams

Fixes the issue where organization-level branding settings were not
being applied to user and team event pages when the direct entity
didn't have hideBranding enabled.

Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
devin-ai-integration[bot]andHariom Balhara authored and GitHub committed 2025-06-12 09:14:55 -03:00
1 parent 2aaf672b10
commit 2fcb8a750d
10 files changed
+220 -7

No files matched your search

+14
View File
@@ -50,6 +50,7 @@ const organizationSelect = {
logoUrl: true,
bannerUrl: true,
isPlatform: true,
hideBranding: true,
};
const organizationWithSettingsSelect = {
...organizationSelect,
@@ -480,6 +481,7 @@ export class ProfileRepository {
bannerUrl: true,
isPrivate: true,
isPlatform: true,
hideBranding: true,
organizationSettings: {
select: {
lockEventTypeCreationForUsers: true,
@@ -659,6 +661,18 @@ export class ProfileRepository {
return normalizeProfile(profile);
}
static async findByUserIdAndOrgSlug({ userId, orgSlug }: { userId: number; orgSlug: string }) {
const profile = await prisma.profile.findFirst({
where: { userId, organization: { slug: orgSlug } },
include: {
organization: {
select: organizationSelect,
},
},
});
return profile;
}
/**
* Personal profile should come from Profile table only
*/