Fix user groups already assigned to an app not being filtered out

This commit is contained in:
Andrew Kingston 2022-09-23 15:42:44 +01:00
parent f6b52cf3f0
commit 5282bb29a3
1 changed files with 2 additions and 1 deletions

View File

@ -39,6 +39,7 @@
$: fixedAppId = apps.getProdAppID(app.devId) $: fixedAppId = apps.getProdAppID(app.devId)
$: availableUsers = getAvailableUsers($usersFetch.rows, appUsers, data) $: availableUsers = getAvailableUsers($usersFetch.rows, appUsers, data)
$: availableGroups = getAvailableGroups($groups, app.appId, search, data) $: availableGroups = getAvailableGroups($groups, app.appId, search, data)
$: console.log(availableGroups)
$: valid = data?.length && !data?.some(x => !x.id?.length || !x.role?.length) $: valid = data?.length && !data?.some(x => !x.id?.length || !x.role?.length)
$: optionSections = { $: optionSections = {
...($licensing.groupsEnabled && ...($licensing.groupsEnabled &&
@ -114,7 +115,7 @@
return (allGroups || []).filter(group => { return (allGroups || []).filter(group => {
// Filter out assigned groups // Filter out assigned groups
const appIds = groups.actions.getGroupAppIds(group) const appIds = groups.actions.getGroupAppIds(group)
if (appIds.includes(appId)) { if (appIds.includes(`app_${appId}`)) {
return false return false
} }