From f39d39ae78944911c3a6cc6fbc5a24a7888e7c1a Mon Sep 17 00:00:00 2001 From: Danny Piper Date: Thu, 7 Sep 2023 11:10:41 +0100 Subject: [PATCH] fix: do not use old next router --- frontend/src/app/q/[...query]/page.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/app/q/[...query]/page.tsx b/frontend/src/app/q/[...query]/page.tsx index 64e8361..dae3865 100644 --- a/frontend/src/app/q/[...query]/page.tsx +++ b/frontend/src/app/q/[...query]/page.tsx @@ -1,6 +1,5 @@ import Card from "./card"; import PageChanger from "./pageChanger"; -import { useRouter } from "next/navigation"; export default async function SearchResultPage({ params, @@ -10,13 +9,12 @@ export default async function SearchResultPage({ page_number?: number; }; }) { - const router = useRouter(); const query = decodeURIComponent(params.query); const resp = await fetch("http://127.0.0.1:4365/api", { method: "POST", body: query, headers: { - page: router.query["page"] || 0 + page: params.page_number?.toString() || '', } }); const data = await resp.json();