Replace PUT by PATCH to promote admin permissions

This commit is contained in:
Bubka
2024-03-14 15:09:05 +01:00
parent e956959f69
commit 86e7601328
6 changed files with 14 additions and 13 deletions

View File

@@ -103,12 +103,12 @@ export default {
},
/**
* Update user
* Promote or demote user from the admin role
*
* @returns promise
*/
update(id, payload, config = {}) {
return apiClient.patch('/users/' + id, payload, { ...config })
promote(id, payload, config = {}) {
return apiClient.patch('/users/' + id + '/promote', payload, { ...config })
},
/**

View File

@@ -100,7 +100,7 @@
}
}
userService.update(managedUser.value.info.id, { 'is_admin': isAdmin }).then(response => {
userService.promote(managedUser.value.info.id, { 'is_admin': isAdmin }).then(response => {
managedUser.value.info.is_admin = response.data.info.is_admin
notify.success({ text: trans('admin.user_role_updated') })
})