From 298161dc7dd9973e1db05b80508c5b9bdcac7624 Mon Sep 17 00:00:00 2001 From: Mandeep56Singh <139469106+Mandeep56Singh@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:30:00 +0530 Subject: [PATCH] fix: resolve incorrect redirect to 404 page on search fields (#3959) Co-authored-by: Brandon Roberts --- components/organisms/Repositories/repositories.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/organisms/Repositories/repositories.tsx b/components/organisms/Repositories/repositories.tsx index c8e8573cb..4bfaf7dd6 100644 --- a/components/organisms/Repositories/repositories.tsx +++ b/components/organisms/Repositories/repositories.tsx @@ -1,6 +1,6 @@ -import { ComponentProps, useEffect, useState } from "react"; -import { useRouter } from "next/router"; import clsx from "clsx"; +import { useRouter } from "next/router"; +import { ComponentProps, useEffect, useState } from "react"; import { usePostHog } from "posthog-js/react"; import TableTitle from "components/atoms/TableTitle/table-title"; @@ -13,8 +13,8 @@ import useSupabaseAuth from "lib/hooks/useSupabaseAuth"; import { setQueryParams } from "lib/utils/query-params"; import Checkbox from "components/atoms/Checkbox/checkbox"; -import Button from "components/shared/Button/button"; import LimitSelect from "components/atoms/Select/limit-select"; +import Button from "components/shared/Button/button"; import { useMediaQuery } from "lib/hooks/useMediaQuery"; import RepositoriesTable, { classNames, RepositoriesRows } from "../RepositoriesTable/repositories-table"; import RepoNotIndexed from "./repository-not-indexed"; @@ -95,10 +95,10 @@ export default function Repositories({ repositories, showSearch = true, personal const handleOnSearch = (search?: string) => { if (selectedFilter && !search) { - return router.push(`/${topic}/${toolName}`); + return router.push(`/explore/topic/${topic}/${toolName}`); } if (search && /^[a-zA-Z0-9\-\.]+\/[a-zA-Z0-9\-\.]+$/.test(search)) { - return router.push(`/${topic}/${toolName}/filter/${search}`); + return router.push(`/explore/topic/${topic}/${toolName}/filter/${search}`); } };