From 2c1306ba2fa7ce2b26ea4443a0a7ab99e878ab4d Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 11 Oct 2019 21:55:27 +0300 Subject: [PATCH] index page default page size --- pages/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.jsx b/pages/index.jsx index 5ed2f7bb..95a67e55 100644 --- a/pages/index.jsx +++ b/pages/index.jsx @@ -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