Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: Searching for tags after paging brings up 404

Luffy211f16e1298c
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) => {