Skip to content

Commit

Permalink
New updateItem method on List for #1705 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Oct 5, 2015
1 parent 2819421 commit 87a3495
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ List.prototype.processFilters = require('./list/processFilters');
List.prototype.register = require('./list/register');
List.prototype.relationship = require('./list/relationship');
List.prototype.selectColumns = require('./list/selectColumns');
List.prototype.set = require('./list/set');
List.prototype.updateItem = require('./list/updateItem');
List.prototype.underscoreMethod = require('./list/underscoreMethod');

/*!
Expand Down
9 changes: 9 additions & 0 deletions lib/list/updateItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function updateItem (item, options, callback) {
var data = options.data || {};
this.fieldsArray.forEach(function(field) {
field.updateItem(item, options.data);
});
item.save(callback);
}

module.exports = updateItem;

0 comments on commit 87a3495

Please sign in to comment.