Skip to content

Scheduling infrastructure for absolutely everyone.

perf: limit # of host members for OG image (#18219)

Benny Joo42aefc9032ef
diff --git a/apps/web/lib/team/[slug]/[type]/getServerSideProps.tsx b/apps/web/lib/team/[slug]/[type]/getServerSideProps.tsx
index e6b068dcf00..4d1af419813 100644
--- a/apps/web/lib/team/[slug]/[type]/getServerSideProps.tsx
+++ b/apps/web/lib/team/[slug]/[type]/getServerSideProps.tsx
@@ -86,6 +86,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
length: true,
hidden: true,
hosts: {
+ take: 3,
select: {
user: {
select: {
@@ -135,6 +136,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
where: { id: eventTypeId },
select: {
users: {
+ take: 1,
select: {
username: true,
name: true,
@@ -143,15 +145,14 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
},
});
- users =
- data.length > 0
- ? [
- {
- username: data[0].username ?? "",
- name: data[0].name ?? "",
- },
- ]
- : [];
+ if (data.length > 0) {
+ users = [
+ {
+ username: data[0].username ?? "",
+ name: data[0].name ?? "",
+ },
+ ];
+ }
}
const orgSlug = isValidOrgDomain ? currentOrgDomain : null;