akiomik / akiomik/hubot-chatwork

`Room(room_id).Tasks().show` does not recognize `opts` parameter?

Aberta
#7 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
CoffeeScript
Estrelas
66
Forks
30
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Thank you for convenient api!

I want to get a user tasks.
So I use an `account` option.

```
room_id = "xxxx"
staff_id = "1234"
opts =
account: staff_id
status: "open"

Room(room_id).Tasks().show opts, (_, json) ->
```

But all tasks given.

I watch a log.
The `body` is correct.

```
Tasks: =>
show: (opts, callback) =>
params = []
params.push "account_id=#{opts.account}" if opts.account?
params.push "assigned_by_account_id=#{opts.assignedBy}" if opts.assignedBy?
params.push "status=#{opts.status}" if opts.status?
body = params.join '&'

@robot.logger.info body
# => account_id=1234&status=open

@get "#{baseUrl}/tasks", body, callback
```

But `request` has no params.

When watch the options, `path` has no query params.

```
# https://github.com/akiomik/hubot-chatwork/blob/master/src/chatwork.coffee#L217

logger.info options
request = HTTPS.request options, (response) ->

# { agent: false,
# host: 'api.chatwork.com',
# port: 443,
# path: '/v1/rooms/xxxxxx/tasks',
# method: 'GET',
# headers:
# { Host: 'api.chatwork.com',
# 'X-ChatWorkToken': 'xxxxxx',
# 'Content-Type': 'application/x-www-form-urlencoded',
# 'Content-Length': 29 } }
```

I hope that the path is `path: '/v1/rooms/xxxxxx/tasks?account_id=1234&status=open'.

I use node v0.10.25. It has breaking changes?

```
$ node -v
v0.10.25
```

thanks

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.