File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,17 +21,18 @@ import Link from "next/link"
2121
2222import { 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 )
You can’t perform that action at this time.
0 commit comments