Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

back to basics

  • Loading branch information...
commit 9150e4c29be45b84a86242a04e06bea58aabfaa9 1 parent 19c2942
@dominictarr authored
Showing with 14 additions and 5 deletions.
  1. +14 −5 server.js
View
19 server.js
@@ -53,13 +53,22 @@ function save (repo){
db.get('' + repo._id, function (err,doc){
- var obj = {}
+ var obj = {_rev: doc && doc._rev,time: new }
for (var key in repo)
obj[key] = repo[key]
- obj._rev = doc && doc._rev
- obj._id = doc._id
- obj.time = new Date()
- db.save(obj,
+ console.log(obj)
+ db.save({
+ _id: '' + repo._id,
+ _rev: doc && doc._rev,
+ time: new Date,
+ username: repo.username,
+ project: repo.project,
+ state: repo.state,
+ report: repo.report,
+ package: repo.package,
+ installation: repo.installation,
+ type: repo.type,
+ },
function (err,data){
repo._rev = data._rev
repo.saving = null
Please sign in to comment.
Something went wrong with that request. Please try again.