diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-09 12:39:31 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-09 12:39:31 -0400 |
| commit | 5b86e4c410ed125c09721359724fb729fb1f7f55 (patch) | |
| tree | d55a792e740193ae3a54e21fb0a583774fb8fab8 /app/node_modules/okresource/index.js | |
| parent | d2e9c90b4d99c05734dd9f8fa1545650703f7114 (diff) | |
Fix bug in OKResource.find
Diffstat (limited to 'app/node_modules/okresource/index.js')
| -rw-r--r-- | app/node_modules/okresource/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/node_modules/okresource/index.js b/app/node_modules/okresource/index.js index 600f0a1..94d8cfb 100644 --- a/app/node_modules/okresource/index.js +++ b/app/node_modules/okresource/index.js @@ -101,11 +101,14 @@ OKResource.prototype.destroy = function(data) { }; OKResource.prototype.find = function(query) { + query = query || {}; + var db = this._db; + var type = this.type; return Q.promise(function(resolve, reject) { if (!query) { throw new Error('No query given'); } else { - this._db.find(this.type, query).then(resolve).fail(reject); + db.find(type, query).then(resolve).fail(reject); } }); }; |
