forked from RiseUP/riseup-squad23
Bug resolvido com o status da consulta e checkbox melhorado
This commit is contained in:
parent
f4ac580b83
commit
41d46cc148
@ -30,6 +30,8 @@ const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
||||
|
||||
const [horariosDisponiveis, sethorariosDisponiveis] = useState([])
|
||||
|
||||
const [status, setStatus] = useState("confirmed")
|
||||
|
||||
let authHeader = getAuthorizationHeader()
|
||||
|
||||
const FormatCPF = (valor) => {
|
||||
@ -204,9 +206,18 @@ const calcularHorarioTermino = (inicio, sessoes, tempoBase) => {
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
alert("Agendamento salvo!");
|
||||
onSave({...agendamento, horarioInicio:horarioInicio})
|
||||
onSave({...agendamento, horarioInicio:horarioInicio, status:status})
|
||||
};
|
||||
|
||||
const handleCheckbox = () => {
|
||||
if(status === "confirmed"){
|
||||
setStatus("requested")
|
||||
}else{
|
||||
setStatus("confirmed")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="form-container">
|
||||
|
||||
@ -355,8 +366,6 @@ const handleSubmit = (e) => {
|
||||
readOnly
|
||||
className="horario-termino-readonly"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -380,7 +389,7 @@ const handleSubmit = (e) => {
|
||||
</div>
|
||||
</form>
|
||||
<div className="campo-de-input-check">
|
||||
<input className="form-check-input form-custom-check" type="checkbox" name="status" onChange={handleChange} />
|
||||
<input className="form-check-input form-custom-check" type="checkbox" name="status" onChange={handleCheckbox} checked={status === "requested"} />
|
||||
<label className="form-check-label checkbox-label" htmlFor="status">
|
||||
Adicionar a fila de espera
|
||||
</label>
|
||||
|
||||
@ -43,6 +43,7 @@ const AgendamentoCadastroManager = ({setPageConsulta, Dict}) => {
|
||||
myHeaders.append("Content-Type", "application/json");
|
||||
|
||||
var raw = JSON.stringify({
|
||||
|
||||
"patient_id": Dict.patient_id,
|
||||
"doctor_id": Dict.doctor_id,
|
||||
"scheduled_at": `${Dict.dataAtendimento}T${Dict.horarioInicio}:00.000Z`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user