1
- import { type Metadata } from "next" ;
2
- import { redirect } from "next/navigation" ;
1
+ import { type Metadata } from "next" ;
2
+ import { redirect } from "next/navigation" ;
3
3
4
- import { List , type Props as ListProps } from "../../components/bookmark/List" ;
5
- import { type Bookmark } from "../../types/Bookmark" ;
6
- import { type PagedCollection } from "../../types/collection" ;
7
- import { type FetchResponse , fetchApi } from "../../utils/dataAccess" ;
8
- import { type Session , auth } from "../auth" ;
4
+ import { List , type Props as ListProps } from "../../components/bookmark/List" ;
5
+ import { type Bookmark } from "../../types/Bookmark" ;
6
+ import { type PagedCollection } from "../../types/collection" ;
7
+ import { fetchApi , type FetchResponse } from "../../utils/dataAccess" ;
8
+ import { auth , type Session } from "../auth" ;
9
9
10
10
interface Query extends URLSearchParams {
11
11
page ?: number | string | null ;
@@ -32,7 +32,7 @@ async function getServerSideProps({ page = 1 }: Query, session: Session): Promis
32
32
return { data : null , hubURL : null , page : Number ( page ) } ;
33
33
}
34
34
35
- export default async function Page ( { searchParams } : { searchParams : Query } ) {
35
+ export default async function Page ( { searchParams } : { searchParams : Promise < Query > } ) {
36
36
// @ts -ignore
37
37
const session : Session | null = await auth ( ) ;
38
38
if ( ! session || session ?. error === "RefreshAccessTokenError" ) {
@@ -41,7 +41,7 @@ export default async function Page({ searchParams }: { searchParams: Query }) {
41
41
redirect ( "/api/auth/signin?callbackUrl=/bookmarks" ) ;
42
42
}
43
43
44
- const props = await getServerSideProps ( searchParams , session ) ;
44
+ const props = await getServerSideProps ( await searchParams , session ) ;
45
45
46
46
return < List { ...props } /> ;
47
47
}
0 commit comments