-
Notifications
You must be signed in to change notification settings - Fork 142
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
Custom sort and filter field with no alias #720
Comments
I'd like to know too. @danielkv have you found a good workaround? I am thinking to create a database view, connect it to a typeorm model and then filter. |
Hi, I didn't! I managed to make it work making a custom service, but wasn't the best way to go. You can check my code in pronto-entregue-nest repository. I'm in the app now, could not copy the url. It's in nestjs-query branch. Some part of the code is in Portuguese If you need any help, I can try to help you out, just let me know here! |
@danielkv Thanks! I managed to implement it using typeorm @ViewEntity, which I linked to my other typeorm entity as a relation and then could use in the DTO and even filter by its props. Only had to make sure my @ViewEntity has @PrimaryColumn to workaround a possible bug in nestjs-query |
Yes, there is. kkk Actually it's was a project I was converting to use nestjs-query, didn't even had a chance to finish. I was talking about this file (Custom Service): https://github.com/danielkv/pronto-entregue-nest/blob/nestjs-query/src/modules/company-association/company/services/company.service.ts
I think with |
Is your feature request related to a problem? Please describe.
I'm trying to sort and filter by a field that's generated in selection, it's not on DB. But the system tries to put an alias which is not the case.
Describe the solution you'd like
It may be a good solution to define allowed sorting fields and filters and how those would work individually
Additional context
This is a custom selection I need to make
I can't filter or sort by field isOpen or nextOpen
The text was updated successfully, but these errors were encountered: