Skip to content

Conversation

@sourodeep23
Copy link
Contributor

No description provided.

}
if (fieldInfo.type === 'String') {
_.set(prismaFilters, `${propertyName}.contains`, value);
if (fieldInfo?.type === 'String' || nestedFieldPath) {
Copy link
Contributor

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);
Copy link
Contributor

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);
}
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well

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

Successfully merging this pull request may close these issues.

3 participants