Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource filter #43

Open
universam1 opened this issue Apr 14, 2020 · 1 comment
Open

resource filter #43

universam1 opened this issue Apr 14, 2020 · 1 comment

Comments

@universam1
Copy link

Thank you for creating this great Redmine interface!

The API supports optional filter, example for users, which is helpful when dealing / looking up in a system with 1000s of users. This support is missing

Before creating or requesting a PR, the question is would you be in favor of strongly typing all possible filter clauses or just extend the methods with variadic filter string support?

Example idea:

func (c *Client) Users(f ...Filter) ([]User, error) {}

So one could call

c.Users()
c.Users(Filter{"name": "JDoe", "status": "2"})

I'd suggest variadic parameters as it keeps backward compatibility and is Redmine version agnostic

@horori
Copy link

horori commented Apr 14, 2020

excellent idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants