fix: Wrong marketplaceInfo value being stored in the database (#35009)
Co-authored-by: Douglas Gubert <1810309+d-gubert@users.noreply.github.com>pull/34974/head
parent
561c3dd648
commit
c0fa1c884c
@ -0,0 +1,10 @@ |
||||
--- |
||||
'@rocket.chat/model-typings': patch |
||||
'@rocket.chat/rest-typings': patch |
||||
'@rocket.chat/apps-engine': patch |
||||
'@rocket.chat/models': patch |
||||
'@rocket.chat/i18n': patch |
||||
'@rocket.chat/meteor': patch |
||||
--- |
||||
|
||||
Fix an issue with apps installations via Marketplace |
||||
@ -1,28 +0,0 @@ |
||||
import type { IMarketplaceInfo } from '@rocket.chat/apps-engine/server/marketplace'; |
||||
import { serverFetch as fetch } from '@rocket.chat/server-fetch'; |
||||
|
||||
export const getMarketplaceAppInfo = async ({ |
||||
baseUrl, |
||||
headers, |
||||
appId, |
||||
version, |
||||
}: { |
||||
baseUrl: string; |
||||
headers: Record<string, any>; |
||||
appId: string; |
||||
version: string; |
||||
}): Promise<IMarketplaceInfo> => { |
||||
const appInfosURL = new URL(`${baseUrl}/v1/apps/${appId}`); |
||||
appInfosURL.searchParams.set('appVersion', String(version)); |
||||
const appInfoResponse = await fetch(appInfosURL.toString(), { |
||||
headers, |
||||
}); |
||||
|
||||
if (!appInfoResponse.ok) { |
||||
const result = await appInfoResponse.json(); |
||||
throw new Error(result?.error || 'Error fetching app information from the Marketplace.'); |
||||
} |
||||
|
||||
const [data] = await appInfoResponse.json(); |
||||
return data; |
||||
}; |
||||
Loading…
Reference in new issue