chore: support update show version

This commit is contained in:
Joel 2024-11-22 15:32:27 +08:00
parent 57756b18e4
commit b93be49530
3 changed files with 4 additions and 3 deletions

View File

@ -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()

View File

@ -79,7 +79,7 @@ export type PluginManifestInMarket = {
icon: string
label: Record<Locale, string>
category: PluginType
version: string // TODO: wait api return current plugin version
version: string // conbine the other place to it
latest_version: string
brief: Record<Locale, string>
introduction: string

View File

@ -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<MarketplaceCollectionsResponse, { url: string; }> = ({ url }) => {