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

dengliming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 412fa1cc fix namespace sync bug (#495)
412fa1cc is described below

commit 412fa1ccadb257cd1cac79d7658a16a1d59c0fbe
Author: aias00 <rok...@163.com>
AuthorDate: Sun Nov 10 18:41:24 2024 +0800

    fix namespace sync bug (#495)
    
    * remove 'resource' button in namespacePlugin
    
    * fix es lint
    
    * fix namespace sync bug
---
 src/models/global.js |  4 ++--
 src/services/api.js  | 12 +++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/models/global.js b/src/models/global.js
index 03d853b5..a43742a1 100644
--- a/src/models/global.js
+++ b/src/models/global.js
@@ -21,7 +21,7 @@ import {
   queryPlatform,
   getAllPlugins,
   getNamespaceList,
-  asyncOnePlugin,
+  asyncByPluginAndNamespace,
   getUserPermissionByToken,
 } from "../services/api";
 import { getIntlContent } from "../utils/IntlUtils";
@@ -83,7 +83,7 @@ export default {
     },
     *asyncPlugin(params, { call }) {
       const { payload } = params;
-      const json = yield call(asyncOnePlugin, payload);
+      const json = yield call(asyncByPluginAndNamespace, payload);
       if (json.code === 200) {
         message.success(getIntlContent("SHENYU.COMMON.RESPONSE.SYNC.SUCCESS"));
       } else {
diff --git a/src/services/api.js b/src/services/api.js
index 8a3142c5..9a82524b 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -556,13 +556,23 @@ export async function asyncConfigImport(params) {
   });
 }
 
-// 同步单个插件
+// sync on plugin
 export async function asyncOnePlugin(params) {
   return request(`${baseUrl}/namespacePlugin/syncPluginData?id=${params.id}`, {
     method: `PUT`,
   });
 }
 
+// sync by plugin and namespace
+export async function asyncByPluginAndNamespace(params) {
+  return request(
+    
`${baseUrl}/namespacePlugin/syncPluginData?id=${params.id}&namespaceId=${params.namespaceId}`,
+    {
+      method: `PUT`,
+    },
+  );
+}
+
 // get plugin dropdown list
 export async function getPluginDropDownList() {
   return request(`${baseUrl}/plugin/all`, {

Reply via email to