This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git


The following commit(s) were added to refs/heads/test by this push:
     new 59b21984 fix: Optimization of request parameters
59b21984 is described below

commit 59b2198499d22b21bf7929caab0801fb1e08062c
Author: shuai <[email protected]>
AuthorDate: Tue Nov 18 11:12:12 2025 +0800

    fix: Optimization of request parameters
---
 ui/src/pages/Admin/Badges/index.tsx | 2 +-
 ui/src/services/admin/badges.ts     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/src/pages/Admin/Badges/index.tsx 
b/ui/src/pages/Admin/Badges/index.tsx
index 9b99f8eb..50396cd4 100644
--- a/ui/src/pages/Admin/Badges/index.tsx
+++ b/ui/src/pages/Admin/Badges/index.tsx
@@ -52,7 +52,7 @@ const Badges: FC = () => {
   const { data, isLoading, mutate } = useQueryBadges({
     page: curPage,
     page_size: PAGE_SIZE,
-    q: curQuery,
+    ...(curQuery ? { q: curQuery } : {}),
     ...(curFilter === 'all' ? {} : { status: curFilter }),
   });
 
diff --git a/ui/src/services/admin/badges.ts b/ui/src/services/admin/badges.ts
index 64685bc5..69ea3403 100644
--- a/ui/src/services/admin/badges.ts
+++ b/ui/src/services/admin/badges.ts
@@ -24,7 +24,7 @@ import request from '@/utils/request';
 import type * as Type from '@/common/interface';
 
 export const useQueryBadges = (params) => {
-  const apiUrl = `/answer/admin/api/badges?${qs.stringify(params)}`;
+  const apiUrl = `/answer/admin/api/badges?${qs.stringify(params, { skipNulls: 
true })}`;
   const { data, error, mutate } = useSWR<
     Type.ListResult<Type.AdminBadgeListItem>,
     Error

Reply via email to