Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bartve committed Nov 3, 2016
1 parent 2a8853c commit 27b5fde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.0.1 / 2016-11-03
==================
* Fixed issue with `database().search()` when using a `Promise`

1.0.0 / 2016-10-27
==================
* When no callback is provided, all API functions now return a native JS `Promise`
Expand Down
8 changes: 4 additions & 4 deletions lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ module.exports = function(client){

database.search = function(query, params, callback){
var obj = {};
if(arguments.length <= 2){
if(typeof params === 'function'){ callback = params; } // No extra search params, the callback is the second function param
}else{
if((arguments.length === 2) && (typeof params === 'function')){
callback = params;
}else if(params){
obj = params;
}
if(query){ obj.q = query; }
obj.q = query||'';
return client.get({url: util.addParams('/database/search', obj), authLevel: 1}, callback);
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "disconnect",
"description": "A full featured Discogs API v2.0 client library",
"version": "1.0.0",
"version": "1.0.1",
"keywords": ["discogs", "api", "client", "oauth"],
"homepage": "https://github.com/bartve/disconnect",
"bugs": "https://github.com/bartve/disconnect/issues",
Expand Down

0 comments on commit 27b5fde

Please sign in to comment.