mirror of https://github.com/halo-dev/halo
perf: retrieve the plugin before updating its status
Signed-off-by: Ryan Wang <i@ryanc.cc>pull/3445/head
parent
e7022a072b
commit
f130c8769e
|
@ -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