Skip to content

Commit

Permalink
refactor: use university as param
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWu098 committed Dec 5, 2024
1 parent 0e50a61 commit 67dd9b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default async function Page({
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
}) {
// ! fix me
const searchUniversity = (await searchParams)["uni"] as string;
const searchUniversity = (await searchParams)["university"] as string;
const searchGE = (await searchParams)["ge"] as string;

const university = searchUniversity || Object.keys(UNIVERSITY_GE)[0];
Expand Down
6 changes: 3 additions & 3 deletions src/components/hero/Examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ const EXAMPLES: Example[] = [
geText: "GE IV - Arts and Humanities",
institution: "UCI",
ge: "IV",
link: "/search?uni=University%20of%20California%2C%20Irvine&ge=GE%20IV",
link: "/search?ge=GE+IV&university=University+of+California,+Irvine",
},
{
name: "UCLA",
geText: "Life Sciences",
institution: "UCLA",
ge: "Scientific Inquiry: Life Sciences",
link: "search?uni=University%20of%20California%2C%20Los%20Angeles&ge=Scientific%20Inquiry%3A%20Life%20Sciences",
link: "/search?ge=Scientific+Inquiry:+Life+Sciences&university=University+of+California,+Los+Angeles",
},
{
name: "UC Santa Barbara",
geText: "GE E - Culture and Thought",
institution: "UCSB",
ge: "E",
link: "/search?uni=University%20of%20California%2C%20Santa%20Barbara&ge=GE%20E",
link: "/search?ge=GE+E&university=University+of+California,+Santa+Barbara",
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/components/search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function Search({
}) {
const { filterValues } = useSearchContext();

const [university, setUniversity] = useQueryState("uni", {
const [university, setUniversity] = useQueryState("university", {
defaultValue: _university,
shallow: false,
clearOnDefault: false,
Expand Down

0 comments on commit 67dd9b7

Please sign in to comment.