|
@@ -1,4 +1,4 @@
|
1
|
|
-import React, { useState } from 'react';
|
|
1
|
+import React, { useState,useEffect } from 'react';
|
2
|
2
|
import { Service } from '../Utils/HTTP'
|
3
|
3
|
import { Box, Paper, Divider, Typography, Button } from '@mui/material'
|
4
|
4
|
|
|
@@ -20,7 +20,9 @@ export function Prueba() {
|
20
|
20
|
let [data, setData] = useState({});
|
21
|
21
|
let [asignacion, setAsignacion] = useState(null);
|
22
|
22
|
|
23
|
|
- useState(() => {
|
|
23
|
+ useEffect(() => {
|
|
24
|
+ let{ profile: perfil }=profile
|
|
25
|
+
|
24
|
26
|
let rest = new Service(`/prueba/findid/${id}`)
|
25
|
27
|
rest.get(auth.token)
|
26
|
28
|
.then(resp => {
|
|
@@ -28,7 +30,7 @@ export function Prueba() {
|
28
|
30
|
})
|
29
|
31
|
.catch(_e => setData({}))
|
30
|
32
|
|
31
|
|
- let status_asign_url = `/prueba/estatus/${profile.profile.pass}/${profile.profile.email}/${id}`
|
|
33
|
+ let status_asign_url = `/prueba/estatus/${perfil.pass}/${perfil.email}/${id}`
|
32
|
34
|
rest = new Service(status_asign_url)
|
33
|
35
|
|
34
|
36
|
rest.getQuery(auth.token)
|
|
@@ -40,7 +42,7 @@ export function Prueba() {
|
40
|
42
|
})
|
41
|
43
|
|
42
|
44
|
|
43
|
|
- }, [id])
|
|
45
|
+ }, [auth.token,id,profile])
|
44
|
46
|
|
45
|
47
|
let now = new Date().toISOString();
|
46
|
48
|
let assig_data = {
|
|
@@ -56,7 +58,7 @@ export function Prueba() {
|
56
|
58
|
"idcontrasenia": profile.role.pass, // ya no se va enviar
|
57
|
59
|
"nombre": "new " + now,
|
58
|
60
|
//cattest_id // catalogo de examenes -> viene del api del catalogo del admin
|
59
|
|
- "cattest_id": data.id
|
|
61
|
+ "cattest_id": data?.id
|
60
|
62
|
}
|
61
|
63
|
|
62
|
64
|
const CreateAssign = () => {
|