concertos no ver detalhes e editar

This commit is contained in:
joao_pedro 2025-11-19 09:01:44 -03:00
parent 1d048023b1
commit ad7c300a44
2 changed files with 17 additions and 6 deletions

View File

@ -22,6 +22,16 @@ const Details = (DictInfo) => {
navigate(`/${prefixo}/pacientes`);
}
const navigateEdit = () => {
const prefixo = location.pathname.split("/")[1];
navigate(`/${prefixo}/medicos/edit`);
}
useEffect(() => {
if (!DictInfo) return;
console.log(patientID, 'teu id')
@ -82,11 +92,9 @@ const Details = (DictInfo) => {
</div>
</div>
<Link to={`edit`}>
<button className="btn btn-light" >
<button className="btn btn-light" onClick={() => navigateEdit()} >
<i className="bi bi-pencil-square"></i> Editar
</button>
</Link>
</div>
</div>

View File

@ -10,6 +10,11 @@ const DoctorDetails = ({DictInfo}) => {
const navigate = useNavigate();
const location = useLocation();
const navigateEdit = () => {
const prefixo = location.pathname.split("/")[1];
navigate(`/${prefixo}/medicos/edit`);
}
const Voltar = () => {
@ -36,11 +41,9 @@ const Voltar = () => {
<p>{DictInfo.cpf || "CPF"}</p>
</div>
</div>
<Link to={`edit`}>
<button className="btn btn-light" onClick={() => {console.log(DictInfo.id)}} >
<button className="btn btn-light" onClick={() => {navigateEdit()}} >
<i className="bi bi-pencil-square"></i> Editar
</button>
</Link>
</div>
</div>