articles pages default page size

This commit is contained in:
tmshv committed 2019-10-11 21:55:53 +03:00
1 parent 2c1306ba2f
commit 28a4d05fe4
1 file changed
+1 -1
+1 -1
View File
@@ -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