From fe455a256acfa02f2a1ac9fcf043160887e6c2f9 Mon Sep 17 00:00:00 2001 From: jp-lima Date: Fri, 3 Oct 2025 23:05:13 -0300 Subject: [PATCH] =?UTF-8?q?Exclus=C3=A3o=20do=20bot=C3=A3o=20de=20cancelar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/doctors/DoctorForm.jsx | 6 +----- src/components/patients/PatientForm.jsx | 12 +++++------- src/pages/DoctorCadastroManager.jsx | 5 +---- src/pages/DoctorEditPage.jsx | 2 +- src/pages/EditPage.jsx | 3 +-- src/pages/PatientCadastroManager.jsx | 5 +---- 6 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/components/doctors/DoctorForm.jsx b/src/components/doctors/DoctorForm.jsx index 6a520f2..8b4ceb8 100644 --- a/src/components/doctors/DoctorForm.jsx +++ b/src/components/doctors/DoctorForm.jsx @@ -502,11 +502,7 @@ function DoctorForm({ onSave, onCancel, formData, setFormData }) { > Salvar Médico - - - + diff --git a/src/components/patients/PatientForm.jsx b/src/components/patients/PatientForm.jsx index c916a6c..cd1eb2f 100644 --- a/src/components/patients/PatientForm.jsx +++ b/src/components/patients/PatientForm.jsx @@ -1,8 +1,10 @@ import React, { useState, useEffect } from 'react'; -import { Link } from 'react-router-dom'; +import { Link,useNavigate, useLocation } from 'react-router-dom'; import { FormatTelefones, FormatPeso, FormatCPF } from '../utils/Formatar/Format'; -function PatientForm({ onSave, onCancel, formData, setFormData }) { +function PatientForm({ onSave, formData, setFormData }) { + + const [errorModalMsg, setErrorModalMsg] = useState(""); const [showModal, setShowModal] = useState(false); const [pacienteExistente, setPacienteExistente] = useState(null); @@ -441,11 +443,7 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) { - - - + {/* Modal de erro - EXATAMENTE COMO NA IMAGEM */} diff --git a/src/pages/DoctorCadastroManager.jsx b/src/pages/DoctorCadastroManager.jsx index f6805e2..2aeca70 100644 --- a/src/pages/DoctorCadastroManager.jsx +++ b/src/pages/DoctorCadastroManager.jsx @@ -95,10 +95,7 @@ function DoctorCadastroManager() {
{ - const prefixo = location.pathname.split("/")[1]; - navigate(`/${prefixo}/medicos`); - }} + formData={DoctorDict} setFormData={setDoctorDict} /> diff --git a/src/pages/DoctorEditPage.jsx b/src/pages/DoctorEditPage.jsx index 513481a..d7c51c4 100644 --- a/src/pages/DoctorEditPage.jsx +++ b/src/pages/DoctorEditPage.jsx @@ -63,7 +63,7 @@ const authHeader = getAuthorizationHeader() { if(response.ok === false){ - console.error("Erro ao atualizar paciente:"); } else{ @@ -79,7 +78,7 @@ const HandlePutPatient = async () => { {navigate('/secretaria/pacientes')}} + formData={PatientToPUT} setFormData={setPatientPUT} /> diff --git a/src/pages/PatientCadastroManager.jsx b/src/pages/PatientCadastroManager.jsx index a2f921c..21f6ad6 100644 --- a/src/pages/PatientCadastroManager.jsx +++ b/src/pages/PatientCadastroManager.jsx @@ -127,10 +127,7 @@ function PatientCadastroManager( {setCurrentPage} ) {
{ - const prefixo = location.pathname.split("/")[1]; - navigate(`/${prefixo}/pacientes`); - }} + formData={formData} setFormData={setFormData} />