From 27722ae87cdfd58c9c4fc3b40c9f3b5441d4afd4 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 2 Aug 2019 15:31:58 +0300 Subject: [PATCH] articles page pageSize from query --- pages/articles/[page].jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/articles/[page].jsx b/pages/articles/[page].jsx index ce402ba2..2d4930ab 100644 --- a/pages/articles/[page].jsx +++ b/pages/articles/[page].jsx @@ -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