Skip to content

Commit

Permalink
Corrijo categoria en edit tour
Browse files Browse the repository at this point in the history
Corrijo categoria en EditTour y back
  • Loading branch information
Karen1308 committed Dec 7, 2023
1 parent 91bb65c commit 3283cfe
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
3 changes: 1 addition & 2 deletions Back/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,20 @@ public ResponseEntity<?> modificar(@RequestParam("id") Long id,
@RequestParam("precioAdulto") Double precioAdulto,
@RequestParam("precioMenor") Double precioMenor,
@RequestParam("categoria") Long categoriaId,
//@RequestParam("rating") String rating,
@RequestParam("rating") String rating,
@RequestParam("duracion") Integer duracion,
@RequestParam("dificultad") TourDificultad dificultad
//@RequestParam("salida[dias]") String dias,
//@RequestParam("salida[fechaDesde]")@DateTimeFormat(pattern = "dd/MM/yyyy")LocalDate fechaDesde,
//@RequestParam("salida[fechaHasta]")@DateTimeFormat(pattern = "dd/MM/yyyy") LocalDate fechaHasta,
//@RequestParam("pasajes") Boolean pasajes,
//@RequestParam("transporte") String transporte,
//@RequestParam("traslado") Boolean traslado,
//@RequestParam("entradas") String entradas,
//@RequestParam("guia") Boolean guia_es,
//@RequestParam("itinerario") String itinerario,
//@RequestParam("alojamiento") Long alojamientoId,
//@RequestPart("imagenes") List<MultipartFile> imagenes
@RequestParam("dificultad") TourDificultad dificultad,
@RequestParam("salida[dias]") String dias,
@RequestParam("salida[fechaDesde]")@DateTimeFormat(pattern = "dd/MM/yyyy")LocalDate fechaDesde,
@RequestParam("salida[fechaHasta]")@DateTimeFormat(pattern = "dd/MM/yyyy") LocalDate fechaHasta,
@RequestParam("pasajes") Boolean pasajes,
@RequestParam("transporte") String transporte,
@RequestParam("traslado") Boolean traslado,
@RequestParam("entradas") String entradas,
@RequestParam("guia") Boolean guia_es,
@RequestParam("itinerario") String itinerario,
@RequestParam("alojamiento") Long alojamientoId,
@RequestPart("imagenes") List<MultipartFile> imagenes
) throws BadRequestException, IOException {

try {
Expand Down
14 changes: 7 additions & 7 deletions Front/src/Components/ui-components/modal/ModalEditTour.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ function ModalEditTour({ tourData, handleSave }) {
});

const handleChange = (e) => {
const { name, value } = e.target;
const { id, value } = e.target;
let parsedValue = value;

if (name === "precioAdulto" || name === "precioMenor" || name === "categoria") {
if (id === "precioAdulto" || id === "precioMenor" || id === "categoria") {
parsedValue = parseInt(value);
}

setTourDataModified({ ...tourDataModified, [name]: parsedValue });
setTourDataModified({ ...tourDataModified, [id]: parsedValue });
};

const handleButtonSave = () => {
Expand All @@ -62,13 +62,13 @@ function ModalEditTour({ tourData, handleSave }) {
<div className="col">
<div className="form-group mb-3">
<small>Duración en días*</small>
<input className="form-control" name="duracion" type="number" value={tourData.duracion} onChange={handleChange} />
<input className="form-control" id="duracion" type="number" value={tourData.duracion} onChange={handleChange} />
</div>
</div>
<div className="col">
<div className="form-group mb-3">
<small>Dificultad*</small>
<select className="form-control" name="dificultad" value={tourDataModified.dificultad} onChange={handleChange} required>
<select className="form-control" id="dificultad" value={tourDataModified.dificultad} onChange={handleChange} required>
<option value="">Seleccione...</option>
<option value="ALTA">Alta</option>
<option value="MEDIA_ALTA">Media-Alta</option>
Expand All @@ -92,13 +92,13 @@ function ModalEditTour({ tourData, handleSave }) {
<div className="col">
<div className="form-group mb-3">
<small>Precio por adulto*</small>
<input className="form-control" name="precioAdulto" type="number" value={tourDataModified["precioAdulto"]} onChange={handleChange} />
<input className="form-control" id="precioAdulto" type="number" value={tourDataModified["precioAdulto"]} onChange={handleChange} />
</div>
</div>
<div className="col">
<div className="form-group mb-3">
<small>Precio por menores*</small>
<input className="form-control" name="precioMenor" type="number" value={tourDataModified["precioMenor"]} onChange={handleChange} />
<input className="form-control" id="precioMenor" type="number" value={tourDataModified["precioMenor"]} onChange={handleChange} />
</div>
</div>
</div>
Expand Down

0 comments on commit 3283cfe

Please sign in to comment.