Merge branch 'fix/develop-merge' of github.com:Budibase/budibase into fix/develop-merge

This commit is contained in:
mike12345567 2022-04-26 15:43:04 +01:00
commit ca7d532443
1 changed files with 14 additions and 11 deletions

View File

@ -2,6 +2,7 @@ import * as rowController from "../../../controllers/row"
import * as appController from "../../../controllers/application"
import { AppStatus } from "../../../../db/utils"
import { BUILTIN_ROLE_IDS } from "@budibase/backend-core/roles"
import { doInTenant } from "@budibase/backend-core/tenancy"
import { TENANT_ID } from "../../../../tests/utilities/structures"
import { getAppDB, doInAppContext } from "@budibase/backend-core/context"
import * as env from "../../../../environment"
@ -32,6 +33,7 @@ export const getAllTableRows = async (config: any) => {
}
export const clearAllApps = async (tenantId = TENANT_ID) => {
await doInTenant(tenantId, async () => {
const req: any = { query: { status: AppStatus.DEV }, user: { tenantId } }
await appController.fetch(req)
const apps = req.body
@ -43,6 +45,7 @@ export const clearAllApps = async (tenantId = TENANT_ID) => {
const req = new Request(null, { appId })
await runRequest(appId, appController.destroy, req)
}
})
}
export const clearAllAutomations = async (config: any) => {