Skip to content

Commit

Permalink
fix: do not use old next router
Browse files Browse the repository at this point in the history
  • Loading branch information
djpiper28 committed Sep 7, 2023
1 parent 06c841a commit f39d39a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions frontend/src/app/q/[...query]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Card from "./card";
import PageChanger from "./pageChanger";
import { useRouter } from "next/navigation";

export default async function SearchResultPage({
params,
Expand All @@ -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();
Expand Down

0 comments on commit f39d39a

Please sign in to comment.