-
Notifications
You must be signed in to change notification settings - Fork 0
Nested Search support added #4
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
base: main
Are you sure you want to change the base?
Conversation
| } | ||
| if (fieldInfo.type === 'String') { | ||
| _.set(prismaFilters, `${propertyName}.contains`, value); | ||
| if (fieldInfo?.type === 'String' || nestedFieldPath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move it to it's independent if block
| if (fieldInfo.type === 'String') { | ||
| _.set(prismaFilters, `${propertyName}.contains`, value); | ||
| if (fieldInfo?.type === 'String' || nestedFieldPath) { | ||
| _.set(prismaFilters, `${nestedFieldPath?nestedFieldPath:propertyName}.contains`, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same in independent if block
| _.set(prismaFilters, `${propertyName}.some.id.in`, value); | ||
| } else { | ||
| _.set(prismaFilters, `${propertyName}.in`, value); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a support for array value, keep in mind we don't have fieldInfo however we can know type of value and based on that we can manage prismafilters
| if (isRelation) { | ||
| _.set(prismaFilters, `${propertyName}.none.id.in`, value); | ||
| } else { | ||
| _.set(prismaFilters, `${propertyName}.not.in`, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
| if (_.isString(value)) { | ||
| _.set(prismaFilters, `${propertyName}.not.contains`, value); | ||
| if (_.isString(value) || nestedFieldPath) { | ||
| _.set(prismaFilters, `${nestedFieldPath?nestedFieldPath:propertyName}.not.contains`, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seperate block
| } | ||
| if (fieldInfo.type === 'DateTime') { | ||
| GT: ({ prismaFilters, value, propertyName, fieldInfo, isRelation, nestedFieldPath }) => { | ||
| if (_.isNumber(value) || fieldInfo?.type === 'DateTime' || nestedFieldPath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well
No description provided.