diff --git a/src/main/java/fr/ulille/iut/todo/ressource/TodoRessource.java b/src/main/java/fr/ulille/iut/todo/ressource/TodoRessource.java
index 9db4c38df25b351a2089a825d985f4881d2e1c98..c71ad28170acbb70b68e70834f28a940a9b7e43e 100644
--- a/src/main/java/fr/ulille/iut/todo/ressource/TodoRessource.java
+++ b/src/main/java/fr/ulille/iut/todo/ressource/TodoRessource.java
@@ -57,7 +57,7 @@ public class TodoRessource {
@GET
@Path("{id}/description")
public String getDescription(@PathParam("id") UUID id) {
- LOGGER.info("getdescription()");
+ LOGGER.info("getDescription()");
return todoService.getTache(id).getDescription();
}
@@ -87,10 +87,22 @@ public class TodoRessource {
LOGGER.info("createTacheFromForm()");
Tache tache = new Tache();
-// tache.setNom(formParams.);
-
-
- return null;
+ String name= formParams.get("nom").get(0);
+ System.out.println(name);
+ tache.setNom(name);
+ todoService.addTache(tache);
+
+ URI location= uri.getAbsolutePathBuilder().path(tache.getId().toString()).build();
+
+ EntityTag etag =new EntityTag(Integer.toString(tache.hashCode()));
+ ResponseBuilder builder = request.evaluatePreconditions(etag);
+
+ if (builder == null) {
+ builder = Response.created(location);
+ builder.tag(etag);
+ builder.entity(tache);
+ }
+ return builder.build();
}
}