Explicitly passing requested appId when calling updateAppPackage

This commit is contained in:
Dean 2022-05-25 15:10:37 +01:00
parent 959e8de94d
commit 756f5b3aa6
2 changed files with 5 additions and 1 deletions

View File

@ -297,6 +297,10 @@ function getContextDB(key, opts) {
toUseAppId = getDevelopmentAppID(appId)
break
}
//If the appId is specified, override context
toUseAppId = opts?.appId ? opts?.appId : toUseAppId
db = dangerousGetDB(toUseAppId, opts)
try {
cls.setOnContext(key, db)

View File

@ -502,7 +502,7 @@ export const sync = async (ctx: any, next: any) => {
}
const updateAppPackage = async (appPackage: any, appId: any) => {
const db = getAppDB()
const db = getAppDB({ appId })
const application = await db.get(DocumentTypes.APP_METADATA)
const newAppPackage = { ...application, ...appPackage }