Skip to content
Browse files

Added more information to edit

  • Loading branch information...
1 parent c9b8239 commit 1351526838f17610cb88f954279fd9fa4237dfb3 @benjreinhart benjreinhart committed Mar 17, 2013
Showing with 9 additions and 2 deletions.
  1. +4 −1 components/edits/datastore.coffee
  2. +3 −0 components/edits/presenter.coffee
  3. +2 −1 scripts/tests/edits
View
5 components/edits/datastore.coffee
@@ -2,9 +2,12 @@
EditSchema = new mongoose.Schema
userId : String
+ authorId : String
original : String
modified : String
- accepted : Boolean
+ accepted : { type: Boolean, default: false }
+ rejected : { type: Boolean, default: false }
createdAt : { type: Date, default: (-> new Date) }
+ permalink : String
module.exports = db.model('Edit', EditSchema)
View
3 components/edits/presenter.coffee
@@ -5,8 +5,11 @@ module.exports = class Edit
{
id : @model.get '_id'
userId : @model.get 'userId'
+ authorId : @model.get 'authorId'
original : @model.get 'original'
modified : @model.get 'modified'
accepted : @model.get 'accepted'
+ rejected : @model.get 'rejected'
createdAt : @model.get 'createdAt'
+ permalink : @model.get 'permalink'
}
View
3 scripts/tests/edits
@@ -6,9 +6,10 @@ echo
curl -d '{
"edit": {
"userId": "123138ur2jd238j",
+ "authorId": "13u92hrir9238h9",
"original": "Matt",
"modified": "The Dude",
- "accepted": false
+ "permalink": "http://domain.com/some-blog-post"
}
}' -H 'content-type:application/json' "http://localhost:3000/edits"

0 comments on commit 1351526

Please sign in to comment.
Something went wrong with that request. Please try again.