fix: marketplace

This commit is contained in:
StyleZhang 2024-10-30 16:36:08 +08:00
parent fd0a830816
commit 02854b273f
2 changed files with 5 additions and 2 deletions

View File

@ -18,7 +18,10 @@ export const getMarketplaceCollectionsAndPlugins = async (query?: CollectionsAnd
const marketplaceCollectionsDataJson = await marketplaceCollectionsData.json()
marketplaceCollections = marketplaceCollectionsDataJson.data.collections
await Promise.all(marketplaceCollections.map(async (collection: MarketplaceCollection) => {
const marketplaceCollectionPluginsData = await globalThis.fetch(`${MARKETPLACE_API_PREFIX}/collections/${collection.name}/plugins?category=${query?.category}`)
let url = `${MARKETPLACE_API_PREFIX}/collections/${collection.name}/plugins`
if (query?.category)
url += `?category=${query.category}`
const marketplaceCollectionPluginsData = await globalThis.fetch(url)
const marketplaceCollectionPluginsDataJson = await marketplaceCollectionPluginsData.json()
const plugins = marketplaceCollectionPluginsDataJson.data.plugins.map((plugin: Plugin) => {
return {

View File

@ -3,7 +3,7 @@ import type { ToolCredential } from '@/app/components/tools/types'
import type { Locale } from '@/i18n'
export enum PluginType {
tool = 'tool',
tool = 'tools',
model = 'model',
extension = 'extension',
}