fix(settings): Fix group creation when editing users

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2025-03-25 14:31:45 -07:00 committed by backportbot[bot]
parent 21dbef7c75
commit 91af8d1f64

View file

@ -749,18 +749,17 @@ export default {
* @param {string} gid Group id
*/
async createGroup({ name: gid }) {
this.loading = { groups: true, subadmins: true }
this.loading.groups = true
try {
await this.$store.dispatch('addGroup', gid)
this.availableGroups.push({ id: gid, name: gid })
const userid = this.user.id
await this.$store.dispatch('addUserGroup', { userid, gid })
this.userGroups.push({ id: gid, name: gid })
} catch (error) {
console.error(error)
} finally {
this.loading = { groups: false, subadmins: false }
logger.error(t('settings', 'Failed to create group'), { error })
}
return this.$store.getters.getGroups[this.groups.length]
this.loading.groups = false
},
/**