Skip to content

Commit a23794b

Browse files
committed
make the filteration works on event page
1 parent 582df0d commit a23794b

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

web/src/app/events/page.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ import Link from "next/link"
2121

2222
import { headers } from "next/headers"
2323

24-
export default async function EventsPage() {
25-
const headersList = headers()
26-
const url = (await headersList).get("x-url") || ""
24+
export default async function EventsPage({
25+
searchParams,
26+
}: {
27+
searchParams: Promise<{ status?: string }>
28+
}) {
29+
const { status } = await searchParams
2730

28-
const searchParams = new URL(url, "http://localhost").searchParams
29-
const status = searchParams.get("status") || undefined
31+
console.log("FINAL STATUS:", status)
3032

31-
console.log(" FINAL STATUS:", status)
3233
const query = status
3334
? `/events?status=${status}`
34-
: "/events/"
35+
: "/events"
3536

3637

3738
const res = await serverApiFetch<{ items: Event[] }>(query)

0 commit comments

Comments
 (0)