Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(students): fix issue where search parameters is incorrectly set
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao authored Jun 8, 2022
1 parent a072a24 commit fdaa5fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/Students.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useState } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { createSearchParams, useNavigate, useSearchParams } from 'react-router-dom';
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
import { useTranslation } from 'react-i18next';
import { styled, alpha } from '@mui/material/styles';
Expand Down Expand Up @@ -139,12 +139,12 @@ const Students = () => {
!isFemale &&
assTypes.length === 0
) {
setStudentsQuery([]);
setSearchParams('');
setStudentsQuery({});
setSearchParams(createSearchParams(''));
} else {
const query = { search: txtSearch, isMale, isFemale, type: assTypes };
setStudentsQuery(query);
setSearchParams(query);
setSearchParams(createSearchParams(query));
}

setIsSearch(true);
Expand Down

0 comments on commit fdaa5fe

Please sign in to comment.