Skip to content

Commit

Permalink
Merge pull request #4 from chyipin/visitors_params
Browse files Browse the repository at this point in the history
Support params for the /visitors api
  • Loading branch information
morus12 committed May 10, 2016
2 parents 6a50ef2 + c2e174b commit 5e7872e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
11 changes: 9 additions & 2 deletions lib/api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}],
"name": "livechatapi",
"description": "Livechat.com API Wrapper",
"version": "0.3.2",
"version": "0.4.0",
"repository": {
"url": ""
},
Expand Down
8 changes: 6 additions & 2 deletions src/api.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,12 @@ class Visitors
constructor: (@api) ->
@path = 'visitors'

list: (callback) =>
@api.get @path, {}, (response) =>
list: (params= {}, callback) =>
if typeof params == 'function' and !callback?
callback = params
params = {}

@api.get @path, params, (response) =>
if callback?
callback response

Expand Down

0 comments on commit 5e7872e

Please sign in to comment.