trello icon indicating copy to clipboard operation
trello copied to clipboard

custom parameters

Open rotsee opened this issue 8 years ago • 5 comments

As far as I can see it's not possible to use e.g. pagination (before) or other parameters when getting cards on a list? Unless I missed something, it would be nice to be able to use all Trello API params

rotsee avatar Dec 16 '16 12:12 rotsee

There isn't a dedicated method but I think you can work around that limitation by using makeRequest(method, path, options, callback). In your specific case, you could call

trello.makeRequest('get', '/1/list/' + listId + '/cards', {before: '2017-07-26T22:28:42.478Z'}, callback);

But I agree with you that all methods would be ideal.

Regards.

cleydyr avatar Jul 26 '17 22:07 cleydyr

Upping this but for another reason.

I love this library because its an easy wrapper around the Trello api. The problem starts when you're in need of something more then just plain getBoards.

When you need to add parameters for filtering you have to fallback to makeRequest to do a proper call to the API.

But when we have to resort to makeRequest for more advanced options whats the point of having a wrapper in the first place, we might aswell use the official client.js library?

There is no second parameter options for the wrapper calls, this is only available for makeRequest.

JensDebergh avatar Nov 21 '17 15:11 JensDebergh

@JensDebergh would a .getBoardsWithExtraParams() that follows the same pattern as the new functions merged in #52 work for your use case?

mgaruccio avatar Nov 21 '17 16:11 mgaruccio

For compatibility reasons this looks like the best solution available. Did you add it for every call available in this library or just the getBoards call?

Best solution would be to rewrite all wrapper function calls to accept an options arguments as second or last parameter (since we can then omit it).

I'm willing to make these changes and commit them but only if this is something that is wanted.

JensDebergh avatar Nov 21 '17 19:11 JensDebergh

I like the idea of a rewrite, but that's ultimately @norberteder call. Originally it was decided to add extra functions rather than introduce potentially breaking changes but at the time we were only discussing one or two specific functions rather than supporting options for all functions.

mgaruccio avatar Dec 01 '17 13:12 mgaruccio