|
@@ -8,7 +8,7 @@ import {
|
8
|
8
|
import toast, { Toaster } from 'react-hot-toast';
|
9
|
9
|
import * as Yup from 'yup';
|
10
|
10
|
|
11
|
|
-import { useQuery, useQueryClient } from 'react-query'
|
|
11
|
+import { useQueryClient } from 'react-query'
|
12
|
12
|
import { Service } from '../../Utils/HTTP.js'
|
13
|
13
|
import { useSelector } from 'react-redux'
|
14
|
14
|
|
|
@@ -19,22 +19,22 @@ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
19
|
19
|
|
20
|
20
|
export function ModalEdit(props) {
|
21
|
21
|
|
22
|
|
- let { password, open, handleOpen } = props
|
|
22
|
+ const auth = useSelector((state) => state.token)
|
23
|
23
|
let [data,setData] = React.useState(null)
|
|
24
|
+ let { password, open, handleOpen } = props
|
24
|
25
|
let { pwd, plz } = password
|
25
|
26
|
|
26
|
|
- const auth = useSelector((state) => state.token)
|
|
27
|
+ React.useEffect(()=> {
|
27
|
28
|
|
28
|
|
- const getPassword = async () => {
|
29
|
|
- let rest = new Service(`/contrasenia/${btoa(pwd)}/${plz}`)
|
30
|
|
- return await rest.getQuery(auth.token)
|
31
|
|
- }
|
|
29
|
+ const getPassword = async () => {
|
|
30
|
+ let rest = new Service(`/contrasenia/${btoa(pwd)}/${plz}`)
|
|
31
|
+ return await rest.getQuery(auth.token)
|
|
32
|
+ }
|
32
|
33
|
|
33
|
|
- React.useEffect(()=> {
|
34
|
34
|
getPassword()
|
35
|
35
|
.then( resp => setData(resp.data))
|
36
|
36
|
.catch( error => console.log(error))
|
37
|
|
- },[])
|
|
37
|
+ },[auth.token,pwd,plz])
|
38
|
38
|
|
39
|
39
|
return (
|
40
|
40
|
<Dialog
|