1
0
Fork 0
mirror of synced 2024-09-30 09:07:25 +13:00

Merge pull request #2603 from Budibase/fix/multitenancy-app-fetch

fix app fetching
This commit is contained in:
Martin McKeaveney 2021-09-14 11:36:49 +01:00 committed by GitHub
commit 8e74a9e951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,9 +231,12 @@ exports.getAllApps = async (CouchDB, { dev, all, idsOnly } = {}) => {
const split = dbName.split(SEPARATOR)
// it is an app, check the tenantId
if (split[0] === DocumentTypes.APP) {
const noTenantId = split.length === 2 || split[1] === DocumentTypes.DEV
// tenantId is always right before the UUID
const possibleTenantId = split[split.length - 2]
const noTenantId =
split.length === 2 || possibleTenantId === DocumentTypes.DEV
return (
(tenantId === DEFAULT_TENANT_ID && noTenantId) ||
possibleTenantId === tenantId