descomentar fetch de registro
This commit is contained in:
parent
ac80892afb
commit
5a2f0846d8
|
@ -150,30 +150,30 @@ const Reservations = () => {
|
|||
}
|
||||
console.log(_reservation)
|
||||
|
||||
/* fetch('http://localhost:4000/reservation/createReservation/', {
|
||||
cache: 'no-cache',
|
||||
method: 'POST',
|
||||
body: JSON.stringify(_reservation),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.status !== 200 && response.status !== 201 )
|
||||
console.log(`Hubo un error en el servicio: ${response.status}`)
|
||||
else return response.json()
|
||||
}).then(() => {*/
|
||||
_reservations.push(_reservation);
|
||||
setReservations(_reservations)
|
||||
toast.current.show({
|
||||
severity: 'success',
|
||||
summary: 'Éxito',
|
||||
detail: 'Reservación realizada',
|
||||
life: 3000,
|
||||
});
|
||||
fetch('http://localhost:4000/reservation/createReservation/', {
|
||||
cache: 'no-cache',
|
||||
method: 'POST',
|
||||
body: JSON.stringify(_reservation),
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.status !== 200 && response.status !== 201)
|
||||
console.log(`Hubo un error en el servicio: ${response.status}`)
|
||||
else return response.json()
|
||||
}).then(() => {
|
||||
_reservations.push(_reservation);
|
||||
setReservations(_reservations)
|
||||
toast.current.show({
|
||||
severity: 'success',
|
||||
summary: 'Éxito',
|
||||
detail: 'Reservación realizada',
|
||||
life: 3000,
|
||||
});
|
||||
|
||||
setReservationDialog(false)
|
||||
/*})*/
|
||||
setReservationDialog(false)
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
@ -591,7 +591,7 @@ const Reservations = () => {
|
|||
value={reservation.date}
|
||||
className={classNames({
|
||||
'p-invalid': submitted && (reservation.date === ''
|
||||
|| validationIsReservation()),
|
||||
|| validationIsReservation()),
|
||||
})}
|
||||
/>
|
||||
|
||||
|
@ -620,7 +620,7 @@ const Reservations = () => {
|
|||
step='3600'
|
||||
className={classNames({
|
||||
'p-invalid': submitted && (reservation.time === ''
|
||||
|| validationTime() || validationIsReservation()),
|
||||
|| validationTime() || validationIsReservation()),
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue