chore: hide cal branding for platform bookings (#22979)
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Rajiv Sahal <sahalrajiv-extc@atharvacoe.ac.in>
This commit is contained in:
co-authored by
Anik Dhabal Babu
Rajiv Sahal
parent
f501ef3269
commit
b4d804de7c
@@ -17,6 +17,7 @@ export const getEventTypesFromDB = async (id: number) => {
|
||||
darkBrandColor: true,
|
||||
email: true,
|
||||
timeZone: true,
|
||||
isPlatformManaged: true,
|
||||
};
|
||||
const eventType = await prisma.eventType.findUnique({
|
||||
where: {
|
||||
@@ -75,6 +76,7 @@ export const getEventTypesFromDB = async (id: number) => {
|
||||
hideBranding: true,
|
||||
},
|
||||
},
|
||||
createdByOAuthClientId: true,
|
||||
},
|
||||
},
|
||||
workflows: {
|
||||
|
||||
@@ -228,16 +228,20 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
? { ...previousBooking, rescheduledBy: bookingInfo.user?.name }
|
||||
: previousBooking;
|
||||
|
||||
const isPlatformBooking = eventType.users[0]?.isPlatformManaged || eventType.team?.createdByOAuthClientId;
|
||||
|
||||
return {
|
||||
props: {
|
||||
orgSlug: currentOrgDomain,
|
||||
themeBasis: eventType.team ? eventType.team.slug : eventType.users[0]?.username,
|
||||
hideBranding: await shouldHideBrandingForEvent({
|
||||
eventTypeId: eventType.id,
|
||||
team: eventType.team,
|
||||
owner: eventType.users[0] ?? null,
|
||||
organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null,
|
||||
}),
|
||||
hideBranding: isPlatformBooking
|
||||
? true
|
||||
: await shouldHideBrandingForEvent({
|
||||
eventTypeId: eventType.id,
|
||||
team: eventType.team,
|
||||
owner: eventType.users[0] ?? null,
|
||||
organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null,
|
||||
}),
|
||||
profile,
|
||||
eventType,
|
||||
recurringBookings: await getRecurringBookings(bookingInfo.recurringEventId),
|
||||
|
||||
@@ -56,6 +56,7 @@ const user: User & { credentials: CredentialPayload[] } = {
|
||||
timeFormat: 12,
|
||||
travelSchedules: [],
|
||||
locked: false,
|
||||
isPlatformManaged: false,
|
||||
};
|
||||
|
||||
const customInputs: CustomInputSchema[] = [];
|
||||
|
||||
@@ -10,6 +10,7 @@ export const availabilityUserSelect = {
|
||||
endTime: true,
|
||||
timeFormat: true,
|
||||
defaultScheduleId: true,
|
||||
isPlatformManaged: true,
|
||||
// Relationships
|
||||
schedules: {
|
||||
select: {
|
||||
|
||||
Reference in New Issue
Block a user