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

QueryFilterFunction receives undefined for search #551

Open
byronferguson opened this issue Jun 19, 2020 · 0 comments
Open

QueryFilterFunction receives undefined for search #551

byronferguson opened this issue Jun 19, 2020 · 0 comments

Comments

@byronferguson
Copy link

When declaring the filter option inside of the @Crud() decorator for a controller it is only working when provided as a static object. When I use the documented QueryFilterFunction, as described [in the docs (https://github.com/nestjsx/crud/wiki/Controllers#filter), the first parameter is receiving undefined and all filters are ignored.

I need to extend any incoming filters with some persisted filters based on the current date for the records. Using new Date() in the static object generates a matching static date-value and therefore breaks my intent. The solution makes sense to use a factory function to merge the search options, but so long as the incoming SCondition is empty that is impossible.

I'm using the latest releases for the following libraries.

"@nestjs/typeorm": "~7.1.0",
"@nestjsx/crud": "~4.6.2",
"@nestjsx/crud-typeorm": "~4.6.2",
"typeorm": "~0.2.25"

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

1 participant