diff --git a/lib/endpoints/search.js b/lib/endpoints/search.js index 42bca61..23b8ac9 100755 --- a/lib/endpoints/search.js +++ b/lib/endpoints/search.js @@ -9,10 +9,10 @@ Search.prototype.all = function(params, callback) { this.executeRequest(this.genEndpoint, params, callback); } -Search.prototype.beers = function(params, callback) { +Search.prototype.beers = function(route, params, callback) { params.key = this.config.key; params.type = "beer"; - this.executeRequest(this.genEndpoint, params, callback); + this.executeRequest(`${this.genEndpoint}${route ? `/${route}` : ``}`, params, callback); } Search.prototype.breweries = function(params, callback) {