|
@@ -32,8 +32,6 @@ export function Resume(props) {
|
32
|
32
|
|
33
|
33
|
let { handleBack, password: key, handleClose, handleReset } = props
|
34
|
34
|
|
35
|
|
- console.log(key)
|
36
|
|
-
|
37
|
35
|
const fmt = React.useRef({ weekday: 'long', year: 'numeric', month: 'short', day: 'numeric' })
|
38
|
36
|
const [loading, setLoading] = React.useState(false);
|
39
|
37
|
|
|
@@ -53,7 +51,6 @@ export function Resume(props) {
|
53
|
51
|
|
54
|
52
|
const pwdMutation = useMutation('password', savePassword);
|
55
|
53
|
const candiMutation = useMutation('candidato', saveCandidato);
|
56
|
|
- console.log(candiMutation)
|
57
|
54
|
|
58
|
55
|
const saveStepper = () => {
|
59
|
56
|
|
|
@@ -71,53 +68,40 @@ export function Resume(props) {
|
71
|
68
|
plaza_id: key.puesto[0].id
|
72
|
69
|
}
|
73
|
70
|
|
74
|
|
- console.log("PWD BODY: ", pwdBody)
|
75
|
|
-
|
76
|
71
|
pwdMutation.mutate(pwdBody, {
|
77
|
72
|
onSuccess: (result) => {
|
78
|
73
|
|
79
|
74
|
let { id: idContrasenia } = result.data;
|
80
|
75
|
|
|
76
|
+ console.log("contrasenia creada : ", idContrasenia)
|
81
|
77
|
|
82
|
78
|
let candidatos_body = key.candidatos.map((candi) => ({
|
83
|
79
|
"id": -1,
|
84
|
80
|
"nombres": candi.nombres,
|
85
|
81
|
"apellidos": candi.apellidos,
|
86
|
82
|
"mail": candi.mail,
|
87
|
|
- "sendmail": 0,
|
|
83
|
+ "sendmail": 1,
|
88
|
84
|
"idContrasenia": idContrasenia,
|
89
|
85
|
"nombrepuesto": 'Senior Software',
|
90
|
86
|
"nombreEmpresa": 'Google'
|
91
|
87
|
}))
|
92
|
88
|
|
93
|
|
- console.log(candidatos_body)
|
94
|
|
-
|
95
|
|
- // setLoading(false);
|
96
|
|
- // return;
|
97
|
|
-
|
98
|
|
- queryClient.invalidateQueries('passwords')
|
99
|
|
- setLoading(false);
|
100
|
|
- handleClose();
|
101
|
|
- handleReset();
|
102
|
|
- /*
|
103
|
|
-
|
104
|
89
|
candiMutation.mutate(candidatos_body, {
|
105
|
90
|
onSuccess: (data) => {
|
106
|
91
|
queryClient.invalidateQueries('passwords')
|
107
|
92
|
toast.success("Contraseña agregada exitosamente!!")
|
108
|
93
|
setTimeout(() => {
|
109
|
|
- console.log("OK LETS GO >> ", data)
|
|
94
|
+ console.log("envio a candidatos >> ", data)
|
110
|
95
|
setLoading(false);
|
111
|
96
|
handleClose();
|
112
|
97
|
handleReset();
|
113
|
98
|
}, 1000)
|
114
|
99
|
},
|
115
|
100
|
onError: () => {
|
116
|
|
- toast.error("Ups!! error al crear el candidato")
|
|
101
|
+ toast.error("Ups!! error al crear la contraseña")
|
117
|
102
|
setLoading(false);
|
118
|
103
|
}
|
119
|
104
|
})
|
120
|
|
-*/
|
121
|
105
|
|
122
|
106
|
},
|
123
|
107
|
onError: () => {
|