From 26288e71d336d23418bb03602d2e098ae5df2369 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 20 Nov 2024 16:32:06 +0800 Subject: [PATCH] fix: local bundle install --- web/service/use-plugins.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/service/use-plugins.ts b/web/service/use-plugins.ts index 6e14d039ab..fd5fa936e7 100644 --- a/web/service/use-plugins.ts +++ b/web/service/use-plugins.ts @@ -128,12 +128,24 @@ export const useInstallFromMarketplaceAndGitHub = ({ try { if (item.type === 'github') { const data = item as GitHubItemAndMarketPlaceDependency + let pluginId = '' + // From local bundle don't have data.value.github_plugin_unique_identifier + if (!data.value.github_plugin_unique_identifier) { + const { unique_identifier } = await post('/workspaces/current/plugin/upload/github', { + body: { + repo: data.value.repo!, + version: data.value.release! || data.value.version!, + package: data.value.packages! || data.value.package!, + }, + }) + pluginId = unique_identifier + } await post('/workspaces/current/plugin/install/github', { body: { repo: data.value.repo!, version: data.value.release! || data.value.version!, package: data.value.packages! || data.value.package!, - plugin_unique_identifier: data.value.github_plugin_unique_identifier!, + plugin_unique_identifier: data.value.github_plugin_unique_identifier! || pluginId, }, }) }