articles pages default page size
This commit is contained in:
1 parent
2c1306ba2f
commit
28a4d05fe4
1 file changed
+1
-1
@@ -31,7 +31,7 @@ const Page = (props) => (
|
||||
Page.getInitialProps = async (ctx) => {
|
||||
const pageUrl = '/'
|
||||
const page = parseInt(ctx.query.page)
|
||||
const pageSize = parseInt(ctx.query.pageSize)
|
||||
const pageSize = parseInt(ctx.query.pageSize) || 15
|
||||
const apiUrl = `http://localhost:3000/api/articles?page=${page}&pageSize=${pageSize}`
|
||||
const res = await axios.get(apiUrl)
|
||||
const articles = res.data.items
|
||||
|
||||
Reference in new issue
Block a user