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

Filter support #5

Open
wisepotato opened this issue Oct 11, 2018 · 3 comments
Open

Filter support #5

wisepotato opened this issue Oct 11, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@wisepotato
Copy link
Contributor

wisepotato commented Oct 11, 2018

I would love to be able to filter the queries sent to the api. A very basic example would include support for the following: JsonApitDotNetCore. Which would include the following:

?filter[attribute]=eq:value
?filter[attribute]=ne:value
?filter[attribute]=lt:value
?filter[attribute]=gt:value
?filter[attribute]=le:value
?filter[attribute]=ge:value
?filter[attribute]=like:value
?filter[attribute]=in:value
@maurei maurei added the enhancement New feature or request label Oct 11, 2018
@maurei
Copy link
Owner

maurei commented Oct 11, 2018

You can now implement this yourself by doing something like

@Model() {

	...
	...
	...

	public static async filter(attr: string, val: string) {
	    const params = new HttpHeaders().set(`filter[${attr}]=${val}');
	    return await this.fetch({params: params})
	} 
	
}

Adding such functionality out of the box would def be a nice idea

@wisepotato
Copy link
Contributor Author

I would suggest a class to import that handles all filter[x]=y requests. Like an adapter type. Or use the regular sql-like syntactic sugar like linq and give a standard implementation

@maurei
Copy link
Owner

maurei commented Oct 12, 2018

A more explicit proposal would be welcome. E.g. some code samples of how the usage would be, and/or some pointers on how to implement.

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

No branches or pull requests

2 participants