Skip to content

Commit

Permalink
Replace returnVals by returnChanges (angular app)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmewes committed May 19, 2015
1 parent 58fda9d commit 8b257d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions todo-angular-koa/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function* create(next) {
try{
var todo = yield parse(this);
todo.createdAt = r.now(); // Set the field `createdAt` to the current time
var result = yield r.table('todos').insert(todo, {returnVals: true}).run(this._rdbConn);
var result = yield r.table('todos').insert(todo, {returnChanges: true}).run(this._rdbConn);

todo = result.new_val; // todo now contains the previous todo + a field `id` and `createdAt`
this.body = JSON.stringify(todo);
Expand All @@ -84,7 +84,7 @@ function* update(next) {
throw new Error("The todo must have a field `id`.");
}

var result = yield r.table('todos').get(todo.id).update(todo, {returnVals: true}).run(this._rdbConn);
var result = yield r.table('todos').get(todo.id).update(todo, {returnChanges: true}).run(this._rdbConn);
this.body = JSON.stringify(result.new_val);
}
catch(e) {
Expand Down

0 comments on commit 8b257d6

Please sign in to comment.