Adding group app cleanup.

This commit is contained in:
mike12345567 2022-09-21 23:12:38 +01:00
parent 7406086c12
commit 6247f686e8
2 changed files with 5 additions and 7 deletions

View File

@ -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)
},
}

View File

@ -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)
}