diff --git a/packages/builder/src/stores/portal/groups.js b/packages/builder/src/stores/portal/groups.js index 656b77f082..66a3ded54e 100644 --- a/packages/builder/src/stores/portal/groups.js +++ b/packages/builder/src/stores/portal/groups.js @@ -67,11 +67,13 @@ export function createGroupsStore() { addApp: async (groupId, appId, roleId) => { await API.addAppsToGroup(groupId, [{ appId, roleId }]) + // refresh the group roles await getGroup(groupId) }, removeApp: async (groupId, appId) => { await API.removeAppsFromGroup(groupId, [{ appId }]) + // refresh the group roles await getGroup(groupId) }, } diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index a9cf1a834d..8d95407268 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -47,14 +47,9 @@ import { checkAppMetadata } from "../../automations/logging" import { getUniqueRows } from "../../utilities/usageQuota/rows" import { quotas } from "@budibase/pro" import { errors, events, migrations } from "@budibase/backend-core" -import { - App, - Layout, - Screen, - MigrationType, - AppNavigation, -} from "@budibase/types" +import { App, Layout, Screen, MigrationType } from "@budibase/types" import { BASE_LAYOUT_PROP_IDS } from "../../constants/layouts" +import { groups } from "@budibase/pro" const URL_REGEX_SLASH = /\/|\\/g @@ -501,6 +496,7 @@ const preDestroyApp = async (ctx: any) => { const postDestroyApp = async (ctx: any) => { const rowCount = ctx.rowCount + await groups.cleanupApp(ctx.params.appId) if (rowCount) { await quotas.removeRows(rowCount) }