Skip to content

Commit

Permalink
Replace returnVals by returnChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmewes committed May 19, 2015
1 parent 937b399 commit 58fda9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions todo-angular-express-promise/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function create(req, res, next) {
var todo = req.body;
todo.createdAt = r.now(); // Set the field `createdAt` to the current time

r.table('todos').insert(todo, {returnVals: true}).run(req._rdbConn).then(function(result) {
r.table('todos').insert(todo, {returnChanges: true}).run(req._rdbConn).then(function(result) {
if (result.inserted !== 1) {
handleError(res, next)(new Error("Document was not inserted."));
}
Expand All @@ -60,7 +60,7 @@ function create(req, res, next) {
function update(req, res, next) {
var todo = req.body;
if ((todo != null) && (todo.id != null)) {
r.table('todos').get(todo.id).update(todo, {returnVals: true}).run(req._rdbConn).then(function(result) {
r.table('todos').get(todo.id).update(todo, {returnChanges: true}).run(req._rdbConn).then(function(result) {
res.send(JSON.stringify(result.new_val));
}).error(handleError(res))
.finally(next);
Expand Down

0 comments on commit 58fda9d

Please sign in to comment.