From 3dafd88dabfd8a069a98a69e4a5695808db0caa8 Mon Sep 17 00:00:00 2001 From: Luther Tchofo Safo <108332538+LutherTS@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:09:21 +0100 Subject: [PATCH] Update page.tsx An integer can be non-positive, but a page number cannot. --- .../website/src/app/(frontend)/posts/page/[pageNumber]/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/website/src/app/(frontend)/posts/page/[pageNumber]/page.tsx b/templates/website/src/app/(frontend)/posts/page/[pageNumber]/page.tsx index e55131d7eb5..93153fa812c 100644 --- a/templates/website/src/app/(frontend)/posts/page/[pageNumber]/page.tsx +++ b/templates/website/src/app/(frontend)/posts/page/[pageNumber]/page.tsx @@ -23,7 +23,7 @@ export default async function Page({ params: paramsPromise }: Args) { const sanitizedPageNumber = Number(pageNumber) - if (!Number.isInteger(sanitizedPageNumber)) notFound() + if (!Number.isInteger(sanitizedPageNumber) || sanitizedPageNumber < 1) notFound() const posts = await payload.find({ collection: 'posts',