From f4baacdeafa13dbc8905037a92adacbf5906f0bd Mon Sep 17 00:00:00 2001 From: Sebastian Mayr Date: Thu, 4 Apr 2013 10:13:32 +0200 Subject: [PATCH] Fixes callback parameters. Adds a callback parameter to all the modify operations. Additionally removes the callback parameter of the find methods since it wasn't used anyway. --- client.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client.js b/client.js index 8c5acb7..6714ed4 100644 --- a/client.js +++ b/client.js @@ -73,32 +73,32 @@ function($rootScope, MeteorCollections, $meteorObject) { } }) } - Collection.find = function(selector, options, callback) { + Collection.find = function(selector, options) { value = this instanceof Collection ? this : []; this.observe(collection.find(selector, options), true); return value; } - Collection.findOne = function(selector, options, callback) { + Collection.findOne = function(selector, options) { value = this instanceof Collection ? this : {}; value = new $meteorObject(collection,collection.find(selector,options).fetch()[0]); this.observe(collection.find(selector, options), false); return value; } - Collection.insert = function(values) { + Collection.insert = function(values, callback) { values = angular.copy(values); cleanupAngularObject(values); - return collection.insert(values); + return collection.insert(values, callback); } - Collection.update = function(selector, updateValues) { + Collection.update = function(selector, updateValues, callback) { updateValues = angular.copy(updateValues); cleanupAngularObject(updateValues); delete updateValues._id; return collection.update(selector, { $set : updateValues - }); + }, callback); } - Collection.remove = function(selector) { - return collection.remove(selector); + Collection.remove = function(selector, callback) { + return collection.remove(selector, callback); } return Collection; }