Skip to content

Commit

Permalink
Correcciones url
Browse files Browse the repository at this point in the history
Corrijo en el EditTour
Corrijo back, porque mandaba todos los campos y los habia comentado en el back.
  • Loading branch information
Karen1308 committed Dec 7, 2023
1 parent 91bb65c commit 6edb53b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 25 deletions.
3 changes: 2 additions & 1 deletion 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
6 changes: 4 additions & 2 deletions Back/api/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ spring.mvc.cors.allowed-methods=GET,POST,PUT,DELETE
spring.mvc.cors.allowed-headers=*

# S3
cloud.aws.credentials.accessKey=${AWS_ACCESS_KEY}
cloud.aws.credentials.secretKey=${AWS_SECRET_KEY}
# cloud.aws.credentials.accessKey=${AWS_ACCESS_KEY}
# cloud.aws.credentials.secretKey=${AWS_SECRET_KEY}
cloud.aws.credentials.accessKey=AKIAY3PLHSUJL2YTRIMU
cloud.aws.credentials.secretKey=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
cloud.aws.region.static=us-east-1
cloud.aws.stack.auto=false

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
4 changes: 2 additions & 2 deletions Front/src/Routes/Detail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Detail = () => {
/* Obtengo el alojamiento */
useEffect(() => {
if (result.alojamiento) {
fetch(`http://localhost:8089/alojamiento/${result.alojamiento}`)
fetch(`http://34.207.134.182:8089/alojamiento/${result.alojamiento}`)
.then((response) => response.json())
.then((data) => {
setLodging(data);
Expand All @@ -61,7 +61,7 @@ const Detail = () => {

// Extraigo las fechas reservadas para deshabilitarlas en el calendario
useEffect(() => {
fetch(`http://localhost:8089/reserva/tour${id}`)
fetch(`http://34.207.134.182:8089/reserva/tour${id}`)
.then((response) => response.json())
.then((data) => {
const reserveDates = data.map((reserve) => {
Expand Down

0 comments on commit 6edb53b

Please sign in to comment.