Revert "perf: Refactor getPublicEvent to fetch org data using DB index key (#21850)"
This reverts commit a37f1d9798.
This commit is contained in:
1 parent
6dad0e7679
commit
218ec9140c
8 files changed
+51
-79
No files matched your search
@@ -121,8 +121,8 @@ async function getDynamicGroupPageProps(context: GetServerSidePropsContext) {
|
||||
const { rescheduleUid, bookingUid } = context.query;
|
||||
const allowRescheduleForCancelledBooking = context.query.allowRescheduleForCancelledBooking === "true";
|
||||
const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(context.req, context.params?.orgSlug);
|
||||
const orgSlug = isValidOrgDomain ? currentOrgDomain : null;
|
||||
if (!orgSlug) {
|
||||
const org = isValidOrgDomain ? currentOrgDomain : null;
|
||||
if (!org) {
|
||||
const redirect = await getTemporaryOrgRedirect({
|
||||
slugs: usernames,
|
||||
redirectType: RedirectType.User,
|
||||
@@ -155,9 +155,8 @@ async function getDynamicGroupPageProps(context: GetServerSidePropsContext) {
|
||||
{
|
||||
username: usernames.join("+"),
|
||||
eventSlug: slug,
|
||||
orgSlug,
|
||||
org,
|
||||
fromRedirectOfNonOrgLink: context.query.orgRedirection === "true",
|
||||
orgId: session?.user?.org?.id ?? session?.user?.profile?.organizationId ?? undefined,
|
||||
},
|
||||
session?.user?.id
|
||||
);
|
||||
@@ -242,7 +241,7 @@ async function getUserPageProps(context: GetServerSidePropsContext) {
|
||||
} as const;
|
||||
}
|
||||
|
||||
const orgSlug = isValidOrgDomain ? currentOrgDomain : null;
|
||||
const org = isValidOrgDomain ? currentOrgDomain : null;
|
||||
|
||||
// We use this to both prefetch the query on the server,
|
||||
// as well as to check if the event exist, so we can show a 404 otherwise.
|
||||
@@ -250,7 +249,7 @@ async function getUserPageProps(context: GetServerSidePropsContext) {
|
||||
{
|
||||
username,
|
||||
eventSlug: slug,
|
||||
orgSlug,
|
||||
org,
|
||||
fromRedirectOfNonOrgLink: context.query.orgRedirection === "true",
|
||||
},
|
||||
session?.user?.id
|
||||
@@ -262,7 +261,7 @@ async function getUserPageProps(context: GetServerSidePropsContext) {
|
||||
} as const;
|
||||
}
|
||||
|
||||
const allowSEOIndexing = orgSlug
|
||||
const allowSEOIndexing = org
|
||||
? user?.profile?.organization?.organizationSettings?.allowSEOIndexing
|
||||
? user?.allowSEOIndexing
|
||||
: false
|
||||
|
||||
Reference in new issue
Block a user