Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve incorrect redirect to 404 page on search fields #3959

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/organisms/Repositories/repositories.tsx
Original file line number Diff line number Diff line change
@@ -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 TableTitle from "components/atoms/TableTitle/table-title";
import Pagination from "components/molecules/Pagination/pagination";
Expand All @@ -12,8 +12,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";
Expand Down Expand Up @@ -91,7 +91,7 @@ export default function Repositories({ repositories, showSearch = true, personal
return router.push(`/${topic}/${toolName}`);
}
Mandeep56Singh marked this conversation as resolved.
Show resolved Hide resolved
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}`);
}
};

Expand Down
Loading