diff --git a/src/main/java/com/pixels/services/PixelService.java b/src/main/java/com/pixels/services/PixelService.java index b768e97..db7f12f 100644 --- a/src/main/java/com/pixels/services/PixelService.java +++ b/src/main/java/com/pixels/services/PixelService.java @@ -92,7 +92,7 @@ public class PixelService { @Path("{id}/modify/") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void modify(@PathParam("id") Long id, @CookieParam("JSESSIONID") Cookie cookie, - @FormParam("red") int red, @FormParam("green") int green, @FormParam("blue") int blue, + @FormParam("red") int red, @FormParam("green") int green, @FormParam("blue") int blue,@FormParam("color") String color, @FormParam("price") int price, @FormParam("description") String description) { // on récupère le pixel de la db via son id Pixel pixel = em.find(Pixel.class, id); @@ -103,7 +103,9 @@ public class PixelService { if (user.equals(pixel.getOwner())) { pixel.setPrice(price); pixel.setDescription(description); - pixel.setColor(String.format("%02X%02X%02X", red, green, blue)); + //pixel.setColor(String.format("%02X%02X%02X", red, green, blue)); + String colorDisplay = color.substring(1,color.length()); + pixel.setColor(colorDisplay); // on ajoute la transaction Date now = new Date(System.currentTimeMillis()); diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index bfab3e9..7de0f11 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -10,6 +10,8 @@ + +
@@ -179,6 +181,8 @@ /> + +