From 1d1eee3513ddce9542485dc5dab75c45a34b276e Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 6 Apr 2021 17:18:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91cron?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/crontab/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index ee19603b..c8ccfa08 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -338,7 +338,7 @@ const Crontab = () => { const handleCancel = (needUpdate?: boolean) => { setIsModalVisible(false); if (needUpdate) { - getCrons(); + getCronDetail(editedCron); } }; @@ -346,15 +346,15 @@ const Crontab = () => { setSearchText(value); }; - const getCronDetail = () => { + const getCronDetail = (cron: any) => { request - .get(`${config.apiPrefix}crons/${logCron._id}`) + .get(`${config.apiPrefix}crons/${cron._id}`) .then((data: any) => { - const index = value.findIndex((x) => x._id === logCron._id); + const index = value.findIndex((x) => x._id === cron._id); const result = [...value]; result.splice(index, 1, { - ...logCron, - status: data.data.status, + ...cron, + ...data.data, }); setValue(result); }) @@ -423,7 +423,7 @@ const Crontab = () => { { - getCronDetail(); + getCronDetail(logCron); setIsLogModalVisible(false); }} cron={logCron}