forked from RiseUP/riseup-squad23
Exclusão do botão de cancelar
This commit is contained in:
parent
1c0ef1cbe5
commit
fe455a256a
@ -502,11 +502,7 @@ function DoctorForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
>
|
>
|
||||||
Salvar Médico
|
Salvar Médico
|
||||||
</button>
|
</button>
|
||||||
<Link to={'/medicos'}>
|
|
||||||
<button className="btn btn-light" onClick={onCancel} style={{ fontSize: '1.2rem', padding: '0.75rem 1.5rem' }}>
|
|
||||||
Cancelar
|
|
||||||
</button>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
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';
|
import { FormatTelefones, FormatPeso, FormatCPF } from '../utils/Formatar/Format';
|
||||||
|
|
||||||
function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
function PatientForm({ onSave, formData, setFormData }) {
|
||||||
|
|
||||||
|
|
||||||
const [errorModalMsg, setErrorModalMsg] = useState("");
|
const [errorModalMsg, setErrorModalMsg] = useState("");
|
||||||
const [showModal, setShowModal] = useState(false);
|
const [showModal, setShowModal] = useState(false);
|
||||||
const [pacienteExistente, setPacienteExistente] = useState(null);
|
const [pacienteExistente, setPacienteExistente] = useState(null);
|
||||||
@ -441,11 +443,7 @@ function PatientForm({ onSave, onCancel, formData, setFormData }) {
|
|||||||
<button className="btn btn-success me-3" onClick={handleSubmit} style={{ fontSize: '1.2rem', padding: '0.75rem 1.5rem' }}>
|
<button className="btn btn-success me-3" onClick={handleSubmit} style={{ fontSize: '1.2rem', padding: '0.75rem 1.5rem' }}>
|
||||||
Salvar Paciente
|
Salvar Paciente
|
||||||
</button>
|
</button>
|
||||||
<Link to='/pacientes'>
|
|
||||||
<button className="btn btn-light" style={{ fontSize: '1.2rem', padding: '0.75rem 1.5rem' }}>
|
|
||||||
Cancelar
|
|
||||||
</button>
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Modal de erro - EXATAMENTE COMO NA IMAGEM */}
|
{/* Modal de erro - EXATAMENTE COMO NA IMAGEM */}
|
||||||
|
|||||||
@ -95,10 +95,7 @@ function DoctorCadastroManager() {
|
|||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<DoctorForm
|
<DoctorForm
|
||||||
onSave={handleSaveDoctor}
|
onSave={handleSaveDoctor}
|
||||||
onCancel={() => {
|
|
||||||
const prefixo = location.pathname.split("/")[1];
|
|
||||||
navigate(`/${prefixo}/medicos`);
|
|
||||||
}}
|
|
||||||
formData={DoctorDict}
|
formData={DoctorDict}
|
||||||
setFormData={setDoctorDict}
|
setFormData={setDoctorDict}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -63,7 +63,7 @@ const authHeader = getAuthorizationHeader()
|
|||||||
|
|
||||||
<DoctorForm
|
<DoctorForm
|
||||||
onSave={HandlePutDoctor}
|
onSave={HandlePutDoctor}
|
||||||
onCancel={console.log('Não atualizar')}
|
|
||||||
formData={DoctorToPUT}
|
formData={DoctorToPUT}
|
||||||
setFormData={setDoctorPUT}
|
setFormData={setDoctorPUT}
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,6 @@ const HandlePutPatient = async () => {
|
|||||||
|
|
||||||
|
|
||||||
if(response.ok === false){
|
if(response.ok === false){
|
||||||
|
|
||||||
console.error("Erro ao atualizar paciente:");
|
console.error("Erro ao atualizar paciente:");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -79,7 +78,7 @@ const HandlePutPatient = async () => {
|
|||||||
|
|
||||||
<PatientForm
|
<PatientForm
|
||||||
onSave={HandlePutPatient}
|
onSave={HandlePutPatient}
|
||||||
onCancel={() => {navigate('/secretaria/pacientes')}}
|
|
||||||
formData={PatientToPUT}
|
formData={PatientToPUT}
|
||||||
setFormData={setPatientPUT}
|
setFormData={setPatientPUT}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -127,10 +127,7 @@ function PatientCadastroManager( {setCurrentPage} ) {
|
|||||||
<div className="col-12">
|
<div className="col-12">
|
||||||
<PatientForm
|
<PatientForm
|
||||||
onSave={handleSavePatient}
|
onSave={handleSavePatient}
|
||||||
onCancel={() => {
|
|
||||||
const prefixo = location.pathname.split("/")[1];
|
|
||||||
navigate(`/${prefixo}/pacientes`);
|
|
||||||
}}
|
|
||||||
formData={formData}
|
formData={formData}
|
||||||
setFormData={setFormData}
|
setFormData={setFormData}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user