diff --git a/src/app/community/page.tsx b/src/app/community/page.tsx index 8e3370c4..3b512c34 100644 --- a/src/app/community/page.tsx +++ b/src/app/community/page.tsx @@ -22,9 +22,8 @@ export const metadata: Metadata = { const Community = async () => { const { clubs } = await api.club.all({}); const session = await getServerAuthSession(); - const events = await api.userMetadata.getEvents(); - if (!session) { + if (!session || !api.userMetadata) { return (
@@ -39,6 +38,9 @@ const Community = async () => {
); } + + const events = await api.userMetadata.getEvents(); + return (
diff --git a/src/components/CommunityEvents.tsx b/src/components/CommunityEvents.tsx index cca4c013..90c051ee 100644 --- a/src/components/CommunityEvents.tsx +++ b/src/components/CommunityEvents.tsx @@ -2,8 +2,22 @@ import EventCard from '@src/components/events/EventCard'; import { SelectEvent } from '@src/server/db/models'; import Link from 'next/link'; +type Event = SelectEvent & { + liked: boolean; + club: { + id: string; + name: string; + description: string; + image: string; + tags: string[]; + approved: "approved" | "rejected" | "pending"; + profileImage: string | null; + soc: boolean; + } +} + type Props = { - events: SelectEvent[] + events: Event[]; } const CommunityEvents = ({ events }: Props) => {