~ the user is set by the service itself
authorAlexandre Bertails <bertails@w3.org>
Thu, 25 Aug 2011 12:56:24 -0400
changeset 75 27f366e0a355
parent 74 53622d809eb1
child 76 96f1bdf10a05
child 81 dbf1af61dfde
~ the user is set by the service itself
src/main/scala/Main.scala
src/test/scala/WorkoutAPISpec.scala
--- a/src/main/scala/Main.scala	Thu Aug 25 12:23:04 2011 -0400
+++ b/src/main/scala/Main.scala	Thu Aug 25 12:56:24 2011 -0400
@@ -39,6 +39,7 @@
   val workoutAPI = unfiltered.filter.Planify {
     case req @ POST(Path(Seg("user" :: user :: "workout" :: Nil))) & Host(host) => {
       val json:MongoDBObject = com.mongodb.util.JSON.parse(Body.string(req)).asInstanceOf[com.mongodb.DBObject]
+      json += "user" -> user
       val workout = grater[Workout].asObject(json)
       WorkoutDAO.insert(workout) match {
         case Some(id) => {
--- a/src/test/scala/WorkoutAPISpec.scala	Thu Aug 25 12:23:04 2011 -0400
+++ b/src/test/scala/WorkoutAPISpec.scala	Thu Aug 25 12:56:24 2011 -0400
@@ -15,7 +15,6 @@
   val workout = """
 {
  "activity": "http://dbpedia.org/resource/Running",
- "user": "jdoe",
  "date": 1314049555595,
  "distance": 5000,
  "events":