From 28a4d05fe414c5cfbbc7f09a8d177c035ed44f2e Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 11 Oct 2019 21:55:53 +0300 Subject: [PATCH] articles pages default page size --- 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 6864152f..7564bf48 100644 --- a/pages/articles/[page].jsx +++ b/pages/articles/[page].jsx @@ -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