update permission add/remove uris

This commit is contained in:
axolotle 2021-03-22 13:16:18 +01:00
parent 65f21c659a
commit 09b8fadc70

View file

@ -216,11 +216,11 @@ export default {
}, },
onPermissionChanged ({ item, index, name, groupType, action }) { onPermissionChanged ({ item, index, name, groupType, action }) {
const uri = 'users/permissions/' + item // const uri = 'users/permissions/' + item
const data = { [action]: name } // const data = { [action]: name }
const from = action === 'add' ? 'availablePermissions' : 'permissions' const from = action === 'add' ? 'availablePermissions' : 'permissions'
const to = action === 'add' ? 'permissions' : 'availablePermissions' const to = action === 'add' ? 'permissions' : 'availablePermissions'
api.put(uri, data).then(() => { api.put(`users/permissions/${item}/${action}/${name}`).then(() => {
this[groupType + 'Groups'][name][from].splice(index, 1) this[groupType + 'Groups'][name][from].splice(index, 1)
this[groupType + 'Groups'][name][to].push(item) this[groupType + 'Groups'][name][to].push(item)
}) })