Skip to content

Commit c2d88e8

Browse files
committed
refactor CREAR prenda hecho, ya anda.
1 parent 9ebbad7 commit c2d88e8

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/main/java/com/outfitlab/project/infrastructure/model/PrendaEntity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public PrendaEntity(String nombre, MarcaEntity marca, String tipo, String imagen
7878

7979
public PrendaEntity(String name, MarcaEntity brandEntity, String type, String imageUrl, ColorEntity color, ClimaEntity climaEntity, Set<OcasionEntity> ocasionesEntities) {
8080
this.nombre = name;
81+
this.marca = brandEntity;
8182
this.tipo = type;
8283
this.imagenUrl = imageUrl;
8384
this.color = color;

src/main/java/com/outfitlab/project/infrastructure/repositories/GarmentRepositoryImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public void createGarment(
7979
String climaNombre,
8080
List<String> ocasionesNombres
8181
) {
82+
System.out.println(brandCode);
8283
MarcaEntity brandEntity = this.brandJpaRepository.findByCodigoMarca(brandCode);
84+
System.out.println("ES NULL ?????? ----------" + brandEntity + " ---- NOSE: --" + brandEntity == null );
8385
if (brandEntity == null) throw new GarmentNotFoundException("No encontramos la brand: " + brandCode);
8486
ClimaEntity climaEntity = this.climaJpaRepository.findClimaEntityByNombre(climaNombre)
8587
.orElseThrow(() -> new IllegalArgumentException("Clima no válido: " + climaNombre));

src/main/java/com/outfitlab/project/presentation/GarmentController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public ResponseEntity<?> getFavorites(@RequestParam(defaultValue = "0") int page
123123

124124
@PostMapping(value = "/new", consumes = "multipart/form-data")
125125
public ResponseEntity<?> newGarment(@ModelAttribute GarmentRequestDTO request, @AuthenticationPrincipal UserDetails user) {
126+
log.info(request.toString());
126127
String brandCode = request.getCodigoMarca();
127128
try{
128129
this.createGarment.execute(

0 commit comments

Comments
 (0)