mirror of https://github.com/halo-dev/halo-admin
perf: retrieve the plugin before updating its status
Signed-off-by: Ryan Wang <i@ryanc.cc>pull/591/head
parent
d583e55390
commit
07ac270890
|
@ -41,12 +41,16 @@ const server = {
|
||||||
title: "上传成功",
|
title: "上传成功",
|
||||||
description: "是否启动当前安装的插件?",
|
description: "是否启动当前安装的插件?",
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
plugin.spec.enabled = true;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const { data: pluginToUpdate } =
|
||||||
|
await apiClient.extension.plugin.getpluginHaloRunV1alpha1Plugin(
|
||||||
|
plugin.metadata.name
|
||||||
|
);
|
||||||
|
pluginToUpdate.spec.enabled = true;
|
||||||
|
|
||||||
await apiClient.extension.plugin.updatepluginHaloRunV1alpha1Plugin(
|
await apiClient.extension.plugin.updatepluginHaloRunV1alpha1Plugin(
|
||||||
plugin.metadata.name,
|
pluginToUpdate.metadata.name,
|
||||||
plugin
|
pluginToUpdate
|
||||||
);
|
);
|
||||||
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|
Loading…
Reference in New Issue