|
|
|
|
@ -14,14 +14,14 @@ export const getMarketplaceCollectionsAndPlugins = async (query?: CollectionsAnd
|
|
|
|
|
let marketplaceCollections = [] as MarketplaceCollection[]
|
|
|
|
|
let marketplaceCollectionPluginsMap = {} as Record<string, Plugin[]>
|
|
|
|
|
try {
|
|
|
|
|
const marketplaceCollectionsData = await globalThis.fetch(`${MARKETPLACE_API_PREFIX}/collections`)
|
|
|
|
|
const marketplaceCollectionsData = await globalThis.fetch(`${MARKETPLACE_API_PREFIX}/collections`, { cache: 'no-store' })
|
|
|
|
|
const marketplaceCollectionsDataJson = await marketplaceCollectionsData.json()
|
|
|
|
|
marketplaceCollections = marketplaceCollectionsDataJson.data.collections
|
|
|
|
|
await Promise.all(marketplaceCollections.map(async (collection: MarketplaceCollection) => {
|
|
|
|
|
let url = `${MARKETPLACE_API_PREFIX}/collections/${collection.name}/plugins`
|
|
|
|
|
if (query?.category)
|
|
|
|
|
url += `?category=${query.category}`
|
|
|
|
|
const marketplaceCollectionPluginsData = await globalThis.fetch(url)
|
|
|
|
|
const marketplaceCollectionPluginsData = await globalThis.fetch(url, { cache: 'no-store' })
|
|
|
|
|
const marketplaceCollectionPluginsDataJson = await marketplaceCollectionPluginsData.json()
|
|
|
|
|
const plugins = marketplaceCollectionPluginsDataJson.data.plugins.map((plugin: Plugin) => {
|
|
|
|
|
return {
|
|
|
|
|
|