From 2f27e750f51041b0eb799ecb78016fedbda1d4dc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 18 Jul 2022 18:18:01 +0100 Subject: [PATCH] PR comments. --- packages/backend-core/src/context/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/src/context/index.ts b/packages/backend-core/src/context/index.ts index 487585ea5f..1e430f01de 100644 --- a/packages/backend-core/src/context/index.ts +++ b/packages/backend-core/src/context/index.ts @@ -67,7 +67,10 @@ export const getTenantIDFromAppID = (appId: string) => { // used for automations, API endpoints should always be in context already export const doInTenant = (tenantId: string | null, task: any) => { - tenantId = tenantId || DEFAULT_TENANT_ID + // make sure default always selected in single tenancy + if (!env.MULTI_TENANCY) { + tenantId = tenantId || DEFAULT_TENANT_ID + } // the internal function is so that we can re-use an existing // context - don't want to close DB on a parent context async function internal(opts = { existing: false }) {