trello
trello copied to clipboard
custom parameters
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
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.
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 would a .getBoardsWithExtraParams() that follows the same pattern as the new functions merged in #52 work for your use case?
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.
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.