|
|
@@ -199,10 +199,24 @@ export function TypePwd(props) {
|
|
|
toast.success('Usuario creado con exito')
|
|
|
console.log("id:", id)
|
|
|
if (userType === ROLE.ASISTENTE) postResources(id)
|
|
|
+ if (userType === ROLE.ADMIN) adminResource(id)
|
|
|
clearForm()
|
|
|
|
|
|
}
|
|
|
|
|
|
+ const adminResource = (user_id) => {
|
|
|
+ let rest = new Service('/rolAdd/' + user_id)
|
|
|
+ let admin_resouce = [
|
|
|
+ {
|
|
|
+ "id": "14",
|
|
|
+ "path": "na"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ let saved = rest.post(admin_resouce, auth.token)
|
|
|
+ console.log('saved:', saved)
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
const postResources = (user_id) => {
|
|
|
let rest = new Service('/rolAdd/' + user_id)
|
|
|
let selected = selectedRole.map(id => ({ id: id, path: "" }))
|