perf: don't fetch all the hosts (#18319)

* perf: don't fetch all the hosts

* fix: type err

* use appschema only when necessary

* Variable casing change and type fixes

* Another missing ts fix

* chore: update variable name

* chore: remove from personal event types

* chore: remove limitHostsToThree

* chore: make it a variable

* chore: move it below

* chore: change name to firstThreeHosts

* chore: update to first three users

* fix: type error

* chore: add firstThreeHosts

* fix: type error

* fix: type error

* fix: support users

* chore: update metadata

* fix: API v2 build error

* chore: change var name

* chore: remove cursorrules

* chore: undo API v2 changes

* chore: add type

---------

Co-authored-by: Hariom <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-01-29 19:05:54 +02:00
1 parent 5c98861f6f
commit 1e610ea684
12 files changed
+159 -124

No files matched your search

@@ -20,9 +20,9 @@ type Props = {
eventData: Omit<
Pick<
NonNullable<Awaited<ReturnType<typeof getPublicEvent>>>,
"id" | "length" | "metadata" | "entity" | "profile" | "title" | "users" | "hidden"
"id" | "length" | "metadata" | "entity" | "profile" | "title" | "subsetOfUsers" | "hidden"
>,
"profile" | "users"
"profile" | "subsetOfUsers"
> & {
profile: {
image: string | undefined;
@@ -163,7 +163,10 @@ async function getDynamicGroupPageProps(context: GetServerSidePropsContext) {
username: eventData.profile.username ?? null,
},
title: eventData.title,
users: eventData.users.map((user) => ({ username: user.username ?? "", name: user.name ?? "" })),
users: eventData.subsetOfUsers.map((user) => ({
username: user.username ?? "",
name: user.name ?? "",
})),
hidden: eventData.hidden,
},
user: usernames.join("+"),
@@ -259,7 +262,10 @@ async function getUserPageProps(context: GetServerSidePropsContext) {
username: eventData.profile.username ?? null,
},
title: eventData.title,
users: eventData.users.map((user) => ({ username: user.username ?? "", name: user.name ?? "" })),
users: eventData.subsetOfUsers.map((user) => ({
username: user.username ?? "",
name: user.name ?? "",
})),
hidden: eventData.hidden,
},
user: username,