diff --git a/src/pages/Details.jsx b/src/pages/Details.jsx index 4edc8780..f7fe3888 100644 --- a/src/pages/Details.jsx +++ b/src/pages/Details.jsx @@ -7,7 +7,7 @@ import { Link } from "react-router-dom"; import { useAuth } from "../components/utils/AuthProvider"; -const Details = () => { +const Details = (DictInfo) => { const parametros = useParams(); const {getAuthorizationHeader, isAuthenticated} = useAuth(); const [paciente, setPaciente] = useState({}); @@ -23,18 +23,18 @@ const Details = () => { } useEffect(() => { - if (!patientID) return; + if (!DictInfo) return; console.log(patientID, 'teu id') const authHeader = getAuthorizationHeader() - GetPatientByID(patientID, authHeader) + GetPatientByID(DictInfo.DictInfo.id, authHeader) .then((data) => { console.log(data, "paciente vindo da API"); setPaciente(data[0]); // supabase retorna array }) .catch((err) => console.error("Erro ao buscar paciente:", err)); - }, [patientID]); + }, [DictInfo]); const handleDelete = async (anexoId) => { @@ -285,4 +285,4 @@ const Details = () => { ); }; -export default Details; \ No newline at end of file +export default Details; diff --git a/src/pages/EditPage.jsx b/src/pages/EditPage.jsx index c3bf9b39..35a33fa1 100644 --- a/src/pages/EditPage.jsx +++ b/src/pages/EditPage.jsx @@ -7,19 +7,23 @@ import { GetPatientByID } from '../components/utils/Functions-Endpoints/Patient' import API_KEY from '../components/utils/apiKeys' import {useNavigate, useParams } from 'react-router-dom' import { useAuth } from '../components/utils/AuthProvider' -const EditPage = () => { + +const EditPage = (DictInfo) => { const navigate = useNavigate() const Parametros = useParams() const [PatientToPUT, setPatientPUT] = useState({}) const { getAuthorizationHeader, isAuthenticated } = useAuth(); - +console.log(DictInfo, "usuario vindo do set") const PatientID = Parametros.id + + useEffect(() => { const authHeader = getAuthorizationHeader() - - GetPatientByID(PatientID, authHeader) + console.log(DictInfo.DictInfo.id, "id do cabra") + + GetPatientByID(DictInfo.DictInfo.id, authHeader) .then((data) => { console.log(data[0], "paciente vindo da API"); setPatientPUT(data[0]); // supabase retorna array @@ -28,7 +32,8 @@ useEffect(() => { -}, [PatientID]) +}, [DictInfo]) + const HandlePutPatient = async () => { const authHeader = getAuthorizationHeader() @@ -86,4 +91,4 @@ const HandlePutPatient = async () => { ) } -export default EditPage \ No newline at end of file +export default EditPage diff --git a/src/pages/TablePaciente.jsx b/src/pages/TablePaciente.jsx index 386e7ad9..ddbdb285 100644 --- a/src/pages/TablePaciente.jsx +++ b/src/pages/TablePaciente.jsx @@ -6,7 +6,7 @@ import "./style/TablePaciente.css"; import ModalErro from "../components/utils/fetchErros/ModalErro"; import manager from "../components/utils/fetchErros/ManagerFunction"; -function TablePaciente({ setCurrentPage, setPatientID }) { +function TablePaciente({ setCurrentPage, setPatientID,setDictInfo }) { const { getAuthorizationHeader, isAuthenticated } = useAuth(); @@ -520,14 +520,14 @@ function TablePaciente({ setCurrentPage, setPatientID }) { {paciente.email || 'Não informado'}
- - - - @@ -679,4 +679,4 @@ function TablePaciente({ setCurrentPage, setPatientID }) { ); } -export default TablePaciente; \ No newline at end of file +export default TablePaciente; diff --git a/src/perfis/perfil_secretaria/PerfilSecretaria.jsx b/src/perfis/perfil_secretaria/PerfilSecretaria.jsx index 5aad4dcd..514c29e1 100644 --- a/src/perfis/perfil_secretaria/PerfilSecretaria.jsx +++ b/src/perfis/perfil_secretaria/PerfilSecretaria.jsx @@ -30,10 +30,10 @@ function PerfilSecretaria({ onLogout }) { }/> } /> } /> - } /> + } /> } /> - } /> - } /> + } /> + } /> } /> } /> } />