-
Notifications
You must be signed in to change notification settings - Fork 203
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
Url query resolver for @Controller methods #65
Comments
Maybe this should be a feature request in nestjs/typeorm reposiotory. TypeOrm integration is not part of this repository. Interesting feature, by the way! |
Update: I publish this package that allows transform Express req.query into TypeORM queries. If you consider interesting adding it as a
import { ORMQuery } from 'nestjs/typeorm';
@Controller('foo')
export class FooController {
@Get()
filter(@ORMQuery() query) {
return this.fooService.find(query);
}
} |
@rjlopezdev please also check some similar work here https://github.com/nestjsx/crud |
This library are so helpfull! it could be integrated sometime on the core project to garantee the support |
Oooops! So sorry, I didn't pay attention to this issue. I think that nestjsx/crud is well supported & its integration is very simple. Closing... 😺 |
I have been on this issue few weeks ago and started working on small components: https://github.com/implicity-healthcare/nest-criteria. Far from being as complete as nestjsx/crud this library has been designed focusing only to handle querying/pagination from the controller layer to the repository layer. |
I'm submitting a...
Current behavior
With the current implementation, there is no easy way to filter data through url query string.
Expected behavior
Empowering Controllers the ability to resolve url querys & building an apropiate
SelectQuery
using TypeORMQueryBuilder
.Given a query string like:
foo/?name=foo&surname__contains=fake&fk__related_prop=2&page=2
It will return the following
SelectQuery
:Update 02/27/2019
I found this library whose owner is @bashleigh that resolves pagination & limit problem (and filterParameters, right).
Could it be interesting to implement proposed feature in this library? Parsing query string and transform it like TypeORM
findOptions
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
A very common use case is to be able to filter content for an endpoint using the url query format.
Environment
The text was updated successfully, but these errors were encountered: