From f04f35b562760afbac0c477357e2a29f77aec3b9 Mon Sep 17 00:00:00 2001
From: lrj <owen.stl@gmail.com>
Date: 星期四, 02 十月 2025 13:51:47 +0800
Subject: [PATCH] fix: 修复评审次数重复显示问题

---
 web/src/api/role.ts |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/web/src/api/role.ts b/web/src/api/role.ts
index 434ee33..441efb4 100644
--- a/web/src/api/role.ts
+++ b/web/src/api/role.ts
@@ -111,8 +111,8 @@
   // 鑾峰彇鎵�鏈夎鑹�
   async getRoles(): Promise<Role[]> {
     try {
-      const data = await graphqlRequest(ROLE_QUERIES.GET_ROLES)
-      return data?.roles || []
+      const result = await graphqlRequest(ROLE_QUERIES.GET_ROLES)
+      return result?.data?.roles || []
     } catch (error: any) {
       throw new Error(error.message || '鑾峰彇瑙掕壊鍒楄〃澶辫触')
     }
@@ -121,8 +121,8 @@
   // 鑾峰彇婵�娲荤姸鎬佺殑瑙掕壊
   async getActiveRoles(): Promise<Role[]> {
     try {
-      const data = await graphqlRequest(ROLE_QUERIES.GET_ACTIVE_ROLES)
-      return data?.activeRoles || []
+      const result = await graphqlRequest(ROLE_QUERIES.GET_ACTIVE_ROLES)
+      return result?.data?.activeRoles || []
     } catch (error: any) {
       throw new Error(error.message || '鑾峰彇婵�娲昏鑹插垪琛ㄥけ璐�')
     }
@@ -131,8 +131,8 @@
   // 鏍规嵁ID鑾峰彇瑙掕壊
    async getRoleById(id: string): Promise<Role | null> {
      try {
-       const data = await graphqlRequest(ROLE_QUERIES.GET_ROLE, { id })
-       return data?.role || null
+       const result = await graphqlRequest(ROLE_QUERIES.GET_ROLE, { id })
+       return result?.data?.role || null
      } catch (error: any) {
        throw new Error(error.message || '鑾峰彇瑙掕壊璇︽儏澶辫触')
      }
@@ -141,8 +141,8 @@
   // 鏍规嵁浠g爜鑾峰彇瑙掕壊
   async getRoleByCode(code: string): Promise<Role | null> {
     try {
-      const data = await graphqlRequest(ROLE_QUERIES.GET_ROLE_BY_CODE, { code })
-      return data?.roleByCode || null
+      const result = await graphqlRequest(ROLE_QUERIES.GET_ROLE_BY_CODE, { code })
+      return result?.data?.roleByCode || null
     } catch (error: any) {
       throw new Error(error.message || '鑾峰彇瑙掕壊璇︽儏澶辫触')
     }
@@ -151,8 +151,8 @@
   // 鏍规嵁鐘舵�佽幏鍙栬鑹�
   async getRolesByState(state: number): Promise<Role[]> {
     try {
-      const data = await graphqlRequest(ROLE_QUERIES.GET_ROLES_BY_STATE, { state })
-      return data?.rolesByState || []
+      const result = await graphqlRequest(ROLE_QUERIES.GET_ROLES_BY_STATE, { state })
+      return result?.data?.rolesByState || []
     } catch (error: any) {
       throw new Error(error.message || '鑾峰彇瑙掕壊鍒楄〃澶辫触')
     }
@@ -161,8 +161,8 @@
   // 鏍规嵁鍚嶇О鎼滅储瑙掕壊
   async searchRolesByName(name: string): Promise<Role[]> {
     try {
-      const data = await graphqlRequest(ROLE_QUERIES.SEARCH_ROLES_BY_NAME, { name })
-      return data?.searchRolesByName || []
+      const result = await graphqlRequest(ROLE_QUERIES.SEARCH_ROLES_BY_NAME, { name })
+      return result?.data?.searchRolesByName || []
     } catch (error: any) {
       throw new Error(error.message || '鎼滅储瑙掕壊澶辫触')
     }

--
Gitblit v1.8.0