From bc77b924c0c0f59c533f38acbcce92b97e489328 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 6 Dec 2022 12:47:48 +0000 Subject: [PATCH] Fixes based on test failures. --- packages/server/src/api/controllers/application.ts | 3 ++- packages/server/src/api/routes/tests/application.spec.js | 1 - packages/server/src/sdk/app/applications/sync.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index a3d0b28ae2..7cb48e53df 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -466,8 +466,9 @@ async function destroyApp(ctx: BBContext) { if (isUnpublish) { appId = dbCore.getProdAppID(appId) + const devAppId = dbCore.getDevAppID(appId) // sync before removing the published app - await sdk.applications.syncApp(appId) + await sdk.applications.syncApp(devAppId) } const db = isUnpublish ? context.getProdAppDB() : context.getAppDB() diff --git a/packages/server/src/api/routes/tests/application.spec.js b/packages/server/src/api/routes/tests/application.spec.js index f62665d184..53b2f0fada 100644 --- a/packages/server/src/api/routes/tests/application.spec.js +++ b/packages/server/src/api/routes/tests/application.spec.js @@ -17,7 +17,6 @@ const { checkBuilderEndpoint, } = require("./utilities/TestFunctions") const setup = require("./utilities") -const { basicScreen, basicLayout } = setup.structures const { AppStatus } = require("../../../db/utils") const { events } = require("@budibase/backend-core") diff --git a/packages/server/src/sdk/app/applications/sync.ts b/packages/server/src/sdk/app/applications/sync.ts index fba135880d..5261eabb3d 100644 --- a/packages/server/src/sdk/app/applications/sync.ts +++ b/packages/server/src/sdk/app/applications/sync.ts @@ -10,7 +10,7 @@ export async function syncApp(appId: string) { } } - if (!dbCore.isDevAppID(appId)) { + if (dbCore.isProdAppID(appId)) { throw new Error("This action cannot be performed for production apps") }