This commit is contained in:
mike12345567 2021-07-23 20:03:11 +01:00
parent a384cc059d
commit cfea184633
2 changed files with 5 additions and 5 deletions

View File

@ -43,8 +43,7 @@ const DocumentTypes = {
exports.DocumentTypes = DocumentTypes exports.DocumentTypes = DocumentTypes
exports.APP_PREFIX = DocumentTypes.APP + SEPARATOR exports.APP_PREFIX = DocumentTypes.APP + SEPARATOR
exports.APP_DEV = exports.APP_DEV = exports.APP_DEV_PREFIX = DocumentTypes.APP_DEV + SEPARATOR
exports.APP_DEV_PREFIX = DocumentTypes.APP_DEV + SEPARATOR
exports.SEPARATOR = SEPARATOR exports.SEPARATOR = SEPARATOR
function isDevApp(app) { function isDevApp(app) {
@ -223,8 +222,10 @@ exports.getAllApps = async ({ tenantId, dev, all } = {}) => {
const noTenantId = split.length === 2 || split[1] === DocumentTypes.DEV const noTenantId = split.length === 2 || split[1] === DocumentTypes.DEV
// tenantId is always right before the UUID // tenantId is always right before the UUID
const possibleTenantId = split[split.length - 2] const possibleTenantId = split[split.length - 2]
return (tenantId === DEFAULT_TENANT_ID && noTenantId) || return (
(possibleTenantId === tenantId) (tenantId === DEFAULT_TENANT_ID && noTenantId) ||
possibleTenantId === tenantId
)
} }
return false return false
}) })

View File

@ -18,7 +18,6 @@ const env = require("../../../environment")
const PLATFORM_INFO_DB = StaticDatabases.PLATFORM_INFO.name const PLATFORM_INFO_DB = StaticDatabases.PLATFORM_INFO.name
const TENANT_DOC = StaticDatabases.PLATFORM_INFO.docs.tenants const TENANT_DOC = StaticDatabases.PLATFORM_INFO.docs.tenants
async function tryAddTenant(tenantId, userId, email) { async function tryAddTenant(tenantId, userId, email) {
const db = new CouchDB(PLATFORM_INFO_DB) const db = new CouchDB(PLATFORM_INFO_DB)
const getDoc = async id => { const getDoc = async id => {