From 87ad2bd12b9c025f2b91a1579d7b6b3775600f6d Mon Sep 17 00:00:00 2001 From: James Purser Date: Mon, 20 Jun 2022 19:33:21 +1000 Subject: [PATCH] Fixed issue with story pager in Tech and Disability --- pages/tech-and-disability.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/tech-and-disability.js b/pages/tech-and-disability.js index be1239d..e82f506 100755 --- a/pages/tech-and-disability.js +++ b/pages/tech-and-disability.js @@ -9,9 +9,9 @@ import Head from 'next/head' export async function getServerSideProps(context) { if(context.query.page == null || context.query.page == '0') { - var page = 0; + var page = 1; } else { - var page = Number(context.query.page) - 1 + var page = Number(context.query.page) } const { serverRuntimeConfig, publicRuntimeConfig } = getConfig() @@ -20,7 +20,7 @@ export async function getServerSideProps(context) { const rssFeed = config.siteURL+"/feed/"+project.data[0].attributes.Slug+"-feed.xml" - const articles = await getAllPosts([project.data[0].attributes.Slug], page, 5) + const articles = await getAllPosts(project.data[0].attributes.Slug, page, 5) const secres = await fetch(serverRuntimeConfig.base_path + `/api/sections`) const secdata = await secres.json()