|
@@ -8,7 +8,7 @@ import {
|
|
|
import toast, { Toaster } from 'react-hot-toast';
|
|
import toast, { Toaster } from 'react-hot-toast';
|
|
|
import * as Yup from 'yup';
|
|
import * as Yup from 'yup';
|
|
|
|
|
|
|
|
-import { useQuery, useQueryClient } from 'react-query'
|
|
|
|
|
|
|
+import { useQueryClient } from 'react-query'
|
|
|
import { Service } from '../../Utils/HTTP.js'
|
|
import { Service } from '../../Utils/HTTP.js'
|
|
|
import { useSelector } from 'react-redux'
|
|
import { useSelector } from 'react-redux'
|
|
|
|
|
|
|
@@ -19,22 +19,22 @@ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
|
|
|
|
|
|
export function ModalEdit(props) {
|
|
export function ModalEdit(props) {
|
|
|
|
|
|
|
|
- let { password, open, handleOpen } = props
|
|
|
|
|
|
|
+ const auth = useSelector((state) => state.token)
|
|
|
let [data,setData] = React.useState(null)
|
|
let [data,setData] = React.useState(null)
|
|
|
|
|
+ let { password, open, handleOpen } = props
|
|
|
let { pwd, plz } = password
|
|
let { pwd, plz } = password
|
|
|
|
|
|
|
|
- const auth = useSelector((state) => state.token)
|
|
|
|
|
|
|
+ React.useEffect(()=> {
|
|
|
|
|
|
|
|
- const getPassword = async () => {
|
|
|
|
|
- let rest = new Service(`/contrasenia/${btoa(pwd)}/${plz}`)
|
|
|
|
|
- return await rest.getQuery(auth.token)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const getPassword = async () => {
|
|
|
|
|
+ let rest = new Service(`/contrasenia/${btoa(pwd)}/${plz}`)
|
|
|
|
|
+ return await rest.getQuery(auth.token)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- React.useEffect(()=> {
|
|
|
|
|
getPassword()
|
|
getPassword()
|
|
|
.then( resp => setData(resp.data))
|
|
.then( resp => setData(resp.data))
|
|
|
.catch( error => console.log(error))
|
|
.catch( error => console.log(error))
|
|
|
- },[])
|
|
|
|
|
|
|
+ },[auth.token,pwd,plz])
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<Dialog
|
|
<Dialog
|