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/dashboard.js | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/web/src/api/dashboard.js b/web/src/api/dashboard.js
index 90aa3c9..ef2e5d1 100644
--- a/web/src/api/dashboard.js
+++ b/web/src/api/dashboard.js
@@ -1,5 +1,4 @@
-// Dashboard API
-const GRAPHQL_ENDPOINT = 'http://localhost:8080/api/graphql';
+import { graphqlRequest } from '../config/api'
// GraphQL 鏌ヨ璇彞
const GET_DASHBOARD_STATS_QUERY = `
@@ -15,19 +14,6 @@
// API 鍑芥暟
export const getDashboardStats = async () => {
- const response = await fetch(GRAPHQL_ENDPOINT, {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({
- query: GET_DASHBOARD_STATS_QUERY
- })
- });
-
- const result = await response.json();
- if (result.errors) {
- throw new Error(result.errors[0].message);
- }
- return result.data.dashboardStats;
+ const data = await graphqlRequest(GET_DASHBOARD_STATS_QUERY);
+ return data.dashboardStats;
};
\ No newline at end of file
--
Gitblit v1.8.0