articles page pageSize from query

This commit is contained in:
tmshv committed 2019-08-02 15:31:58 +03:00
1 parent 56a6735bfd
commit 27722ae87c
1 file changed
+1 -1
+1 -1
View File
@@ -34,7 +34,7 @@ const Page = (props) => (
Page.getInitialProps = async (ctx) => {
const pageUrl = '/'
const page = parseInt(ctx.query.page)
const pageSize = 10
const pageSize = parseInt(ctx.query.pageSize)
const apiUrl = `http://localhost:3000/api/articles?page=${page}&pageSize=${pageSize}`
const res = await axios.get(apiUrl)
const articles = res.data.items