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