perf: retrieve the plugin before updating its status

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/591/head
Ryan Wang 2022-07-24 22:15:30 +08:00
parent d583e55390
commit 07ac270890
1 changed files with 8 additions and 4 deletions

View File

@ -41,12 +41,16 @@ const server = {
title: "上传成功",
description: "是否启动当前安装的插件?",
onConfirm: async () => {
plugin.spec.enabled = true;
try {
const { data: pluginToUpdate } =
await apiClient.extension.plugin.getpluginHaloRunV1alpha1Plugin(
plugin.metadata.name
);
pluginToUpdate.spec.enabled = true;
await apiClient.extension.plugin.updatepluginHaloRunV1alpha1Plugin(
plugin.metadata.name,
plugin
pluginToUpdate.metadata.name,
pluginToUpdate
);
window.location.reload();