mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-19 09:51:35 +02:00
Replace PUT by PATCH to promote admin permissions
This commit is contained in:
6
resources/js/services/userService.js
vendored
6
resources/js/services/userService.js
vendored
@@ -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 })
|
||||
},
|
||||
|
||||
/**
|
||||
|
@@ -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') })
|
||||
})
|
||||
|
Reference in New Issue
Block a user