File tree 1 file changed +3
-16
lines changed
1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,7 @@ import { Book } from 'react-feather';
9
9
10
10
11
11
type Props = {
12
- token ?: string ,
13
12
data ?: any ,
14
- bookmarkResouces ?: Resource [ ] ,
15
- bookmark ?: string
16
13
}
17
14
18
15
@@ -128,26 +125,16 @@ const Home = ({
128
125
)
129
126
}
130
127
131
- export async function getServerSideProps ( { query } : { query : { token : string , bookmark : string } } ) {
128
+ export async function getStaticProps ( ) {
132
129
const res = await fetch ( process . env . NEXT_PUBLIC_LAZYWEB_BACKEND_URL + '/api/websites' )
133
130
const data = await res . json ( )
134
131
135
- let bookmarkResouces = [ ]
136
- if ( query ?. bookmark ) {
137
- const res = await fetch ( process . env . NEXT_PUBLIC_LAZYWEB_BACKEND_URL + `/api/websites/bookmarks/${ query ?. bookmark } ` )
138
- const bookmarkData = await res . json ( )
139
- bookmarkResouces = bookmarkData ?. resources
140
- }
141
-
142
132
return {
143
133
props : {
144
- token : query ?. token || '' ,
145
134
data,
146
- bookmarkResouces,
147
- bookmark : query ?. bookmark || ''
148
- }
135
+ } ,
136
+ revalidate : 60 , // Revalidate at most once per minute
149
137
} ;
150
138
}
151
139
152
-
153
140
export default Home
You can’t perform that action at this time.
0 commit comments