This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
The following commit(s) were added to refs/heads/dev by this push:
new 211f16e1 fix: Searching for tags after paging brings up 404
211f16e1 is described below
commit 211f16e1298cc359e94fd158b3e80ef509be1cc2
Author: Luffy <[email protected]>
AuthorDate: Thu Jan 9 16:37:51 2025 +0800
fix: Searching for tags after paging brings up 404
---
ui/src/pages/Tags/index.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui/src/pages/Tags/index.tsx b/ui/src/pages/Tags/index.tsx
index e8f682f7..b3e22fff 100644
--- a/ui/src/pages/Tags/index.tsx
+++ b/ui/src/pages/Tags/index.tsx
@@ -32,7 +32,7 @@ import { loggedUserInfoStore } from '@/stores';
const sortBtns = ['popular', 'name', 'newest'];
const Tags = () => {
- const [urlSearch] = useSearchParams();
+ const [urlSearch, setUrlSearch] = useSearchParams();
const { t } = useTranslation('translation', { keyPrefix: 'tags' });
const [searchTag, setSearchTag] = useState('');
const { role_id } = loggedUserInfoStore((_) => _.user);
@@ -56,6 +56,10 @@ const Tags = () => {
const handleChange = (e) => {
setSearchTag(e.target.value);
+ setUrlSearch((prev) => {
+ prev.set('page', '1');
+ return prev;
+ });
};
const handleFollow = (tag) => {