From 3f6ede4d3c589ac53f991324edfd8000b97cdaf4 Mon Sep 17 00:00:00 2001 From: fengyangsy <50993298+fengyangsy@users.noreply.github.com> Date: Sat, 17 Sep 2022 06:32:52 +0800 Subject: [PATCH] [#issue-487]Modify the request to create a node (#488) * [#issue-487]Modify the request to create a node 1. Change the quantity parameter to a number 2. The action parameter is passed through the message body Signed-off-by: fengyang_sy * Update node.js * Update index.js * Update index.js * Update node.js * Update index.js * Update index.js Signed-off-by: fengyang_sy --- src/dashboard/src/pages/Operator/Node/index.js | 3 ++- src/dashboard/src/services/node.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dashboard/src/pages/Operator/Node/index.js b/src/dashboard/src/pages/Operator/Node/index.js index 1d20d1f94..66d0e4ff5 100644 --- a/src/dashboard/src/pages/Operator/Node/index.js +++ b/src/dashboard/src/pages/Operator/Node/index.js @@ -207,7 +207,8 @@ const CreateNode = props => { }; const onFinish = values => { - handleCreate(values, createCallback); + const msg = { ...values, num: parseInt(values.num, 10) }; + handleCreate(msg, createCallback); }; const formItemLayout = { diff --git a/src/dashboard/src/services/node.js b/src/dashboard/src/services/node.js index 0e435de46..258a7f498 100644 --- a/src/dashboard/src/services/node.js +++ b/src/dashboard/src/services/node.js @@ -34,7 +34,8 @@ export async function deleteNode(params) { } export async function operateNode(params) { - return request(`/api/v1/nodes/${params.id}/operations?action=${params.message}`, { + return request(`/api/v1/nodes/${params.id}/operations`, { method: 'POST', + data: { action: params.message }, }); }