diff --git a/web/app/components/plugins/plugin-page/index.tsx b/web/app/components/plugins/plugin-page/index.tsx index 486f4f47ce..26cf4b1659 100644 --- a/web/app/components/plugins/plugin-page/index.tsx +++ b/web/app/components/plugins/plugin-page/index.tsx @@ -76,9 +76,10 @@ const PluginPage = ({ await sleep(100) if (packageId) { const { data } = await fetchManifestFromMarketPlace(encodeURIComponent(packageId)) - const { plugin } = data + const { plugin, version } = data setManifest({ ...plugin, + version: version.version, icon: `${marketplaceApiPrefix}/plugins/${plugin.org}/${plugin.name}/icon`, }) showInstallFromMarketplace() diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index 5de8a6d2df..1ab127ec55 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -79,7 +79,7 @@ export type PluginManifestInMarket = { icon: string label: Record category: PluginType - version: string // TODO: wait api return current plugin version + version: string // conbine the other place to it latest_version: string brief: Record introduction: string diff --git a/web/service/plugins.ts b/web/service/plugins.ts index 28bf6c44f4..ef948966da 100644 --- a/web/service/plugins.ts +++ b/web/service/plugins.ts @@ -63,7 +63,7 @@ export const fetchManifest = async (uniqueIdentifier: string) => { } export const fetchManifestFromMarketPlace = async (uniqueIdentifier: string) => { - return getMarketplace<{ data: { plugin: PluginManifestInMarket } }>(`/plugins/identifier?unique_identifier=${uniqueIdentifier}`) + return getMarketplace<{ data: { plugin: PluginManifestInMarket, version: { version: string } } }>(`/plugins/identifier?unique_identifier=${uniqueIdentifier}`) } export const fetchMarketplaceCollections: Fetcher = ({ url }) => {