index page default page size

This commit is contained in:
tmshv committed 2019-10-11 21:55:27 +03:00
1 parent fd126998bd
commit 2c1306ba2f
1 file changed
+1 -1
+1 -1
View File
@@ -35,7 +35,7 @@ const Page = (props) => (
Page.getInitialProps = async (ctx) => {
const pageUrl = '/'
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 res = await axios.get(apiUrl)
const articles = res.data.items