Browse Source

admin role setup

amenpunk 1 year ago
parent
commit
b81c8f43be
1 changed files with 14 additions and 0 deletions
  1. 14 0
      src/Components/Password/Steps/TypePwd.jsx

+ 14 - 0
src/Components/Password/Steps/TypePwd.jsx

@@ -199,10 +199,24 @@ export function TypePwd(props) {
199 199
     toast.success('Usuario creado con exito')
200 200
     console.log("id:", id)
201 201
     if (userType === ROLE.ASISTENTE) postResources(id)
202
+    if (userType === ROLE.ADMIN) adminResource(id)
202 203
     clearForm()
203 204
 
204 205
   }
205 206
 
207
+  const adminResource = (user_id) => {
208
+    let rest = new Service('/rolAdd/' + user_id)
209
+    let admin_resouce = [
210
+      {
211
+        "id": "14",
212
+        "path": "na"
213
+      }
214
+    ]
215
+    let saved = rest.post(admin_resouce, auth.token)
216
+    console.log('saved:', saved)
217
+    
218
+  }
219
+
206 220
   const postResources = (user_id) => {
207 221
     let rest = new Service('/rolAdd/' + user_id)
208 222
     let selected = selectedRole.map(id => ({ id: id, path: "" }))