Skip to content

Commit b39bee9

Browse files
committed
Remove unused props and update getServerSideProps
1 parent f681b29 commit b39bee9

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

lazyweb/pages/index.tsx

+3-16
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import { Book } from 'react-feather';
99

1010

1111
type Props = {
12-
token?: string,
1312
data?: any,
14-
bookmarkResouces?: Resource[],
15-
bookmark?: string
1613
}
1714

1815

@@ -128,26 +125,16 @@ const Home = ({
128125
)
129126
}
130127

131-
export async function getServerSideProps({ query }: { query: { token: string, bookmark: string } }) {
128+
export async function getStaticProps() {
132129
const res = await fetch(process.env.NEXT_PUBLIC_LAZYWEB_BACKEND_URL + '/api/websites')
133130
const data = await res.json()
134131

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-
142132
return {
143133
props: {
144-
token: query?.token || '',
145134
data,
146-
bookmarkResouces,
147-
bookmark: query?.bookmark || ''
148-
}
135+
},
136+
revalidate: 60, // Revalidate at most once per minute
149137
};
150138
}
151139

152-
153140
export default Home

0 commit comments

Comments
 (0)