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

hefengen 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 c34cec11 [type:fix] Correct Plugin ID Query in Namespace Plugin Edit 
Page (#475)
c34cec11 is described below

commit c34cec11a752df298b96b1d903eeba6d9e0fd502
Author: VampireAchao <ac...@apache.org>
AuthorDate: Tue Aug 20 16:03:21 2024 +0800

    [type:fix] Correct Plugin ID Query in Namespace Plugin Edit Page (#475)
    
    * [type:fix] Correct Plugin ID Query in Namespace Plugin Edit Page
    
    * [type:fix] use "/{pluginId}/{namespaceId}"
---
 src/routes/System/NamespacePlugin/index.js | 11 ++++++++---
 src/services/api.js                        |  2 +-
 src/utils/namespacePlugin.js               |  4 ++--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/routes/System/NamespacePlugin/index.js 
b/src/routes/System/NamespacePlugin/index.js
index baceaa23..c983d9f7 100644
--- a/src/routes/System/NamespacePlugin/index.js
+++ b/src/routes/System/NamespacePlugin/index.js
@@ -143,7 +143,7 @@ export default class NamespacePlugin extends Component {
   editClick = (record) => {
     const { dispatch, currentNamespaceId } = this.props;
     getUpdateModal({
-      id: record.id,
+      pluginId: record.pluginId,
       namespaceId: currentNamespaceId,
       dispatch,
       fetchValue: this.currentQueryPayload(),
@@ -231,13 +231,18 @@ export default class NamespacePlugin extends Component {
 
   // 批量启用或禁用
   enableClick = () => {
-    const { dispatch, currentNamespaceId } = this.props;
+    const {
+      dispatch,
+      currentNamespaceId,
+      namespacePlugin: { namespacePluginList },
+    } = this.props;
     const { selectedRowKeys } = this.state;
     if (selectedRowKeys && selectedRowKeys.length > 0) {
       dispatch({
         type: "namespacePlugin/fetchItem",
         payload: {
-          id: selectedRowKeys[0],
+          pluginId: namespacePluginList.find((i) => i.id === 
selectedRowKeys[0])
+            ?.pluginId,
           namespaceId: currentNamespaceId,
         },
         callback: (user) => {
diff --git a/src/services/api.js b/src/services/api.js
index e245eea2..5c66e5eb 100644
--- a/src/services/api.js
+++ b/src/services/api.js
@@ -1174,7 +1174,7 @@ export async function deleteNamespace(params) {
 /* findNamespacePlugin */
 export async function findNamespacePlugin(params) {
   return request(
-    
`${baseUrl}/namespacePlugin/id=${params.id}&namespaceId=${params.namespaceId}`,
+    `${baseUrl}/namespacePlugin/${params.pluginId}/${params.namespaceId}`,
     {
       method: `GET`,
     },
diff --git a/src/utils/namespacePlugin.js b/src/utils/namespacePlugin.js
index e45c4c3b..07da838c 100644
--- a/src/utils/namespacePlugin.js
+++ b/src/utils/namespacePlugin.js
@@ -20,7 +20,7 @@ import { refreshAuthMenus } from "./AuthRoute";
 import AddModal from "../routes/System/NamespacePlugin/AddModal";
 
 export function getUpdateModal({
-  id,
+  pluginId,
   namespaceId,
   dispatch,
   fetchValue,
@@ -31,7 +31,7 @@ export function getUpdateModal({
   dispatch({
     type: "namespacePlugin/fetchItem",
     payload: {
-      id,
+      pluginId,
       namespaceId,
     },
     callback: (plugin) => {

Reply via email to