1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00

Fix: Load apps when using the default multi tenant

This commit is contained in:
Rory Powell 2022-01-11 12:31:40 +00:00
parent f74090d2eb
commit d3a0534798

View file

@ -224,8 +224,15 @@ exports.getAllDbs = async () => {
}
}
let couchUrl = `${exports.getCouchUrl()}/_all_dbs`
if (env.MULTI_TENANCY) {
let tenantId = getTenantId()
let tenantId = getTenantId()
if (!env.MULTI_TENANCY || tenantId == DEFAULT_TENANT_ID) {
// just get all DBs when:
// - single tenancy
// - default tenant
// - apps dbs don't contain tenant id
// - non-default tenant dbs are filtered out application side in getAllApps
await addDbs(couchUrl)
} else {
// get prod apps
await addDbs(
exports.getStartEndKeyURL(couchUrl, DocumentTypes.APP, tenantId)
@ -236,9 +243,6 @@ exports.getAllDbs = async () => {
)
// add global db name
dbs.push(getGlobalDBName(tenantId))
} else {
// just get all DBs in self host
await addDbs(couchUrl)
}
return dbs
}