Browse Source

fix: user field condition issue

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/7202/head
mertmit 11 months ago
parent
commit
1a7151dd3d
  1. 31
      packages/nocodb/src/db/conditionV2.ts

31
packages/nocodb/src/db/conditionV2.ts

@ -459,30 +459,17 @@ const parseConditionV2 = async (
const filterVal = filter.value.toLowerCase();
if (filterVal.startsWith('%') && filterVal.endsWith('%')) {
return (
user.display_name
.toLowerCase()
.includes(filterVal.substring(1, filterVal.length - 1)) ||
user.email
.toLowerCase()
.includes(filterVal.substring(1, filterVal.length - 1))
);
return (user.display_name || user.email)
.toLowerCase()
.includes(filterVal.substring(1, filterVal.length - 1));
} else if (filterVal.startsWith('%')) {
return (
user.display_name
.toLowerCase()
.endsWith(filterVal.substring(1)) ||
user.email.toLowerCase().endsWith(filterVal.substring(1))
);
return (user.display_name || user.email)
.toLowerCase()
.endsWith(filterVal.substring(1));
} else if (filterVal.endsWith('%')) {
return (
user.display_name
.toLowerCase()
.startsWith(filterVal.substring(0, filterVal.length - 1)) ||
user.email
.toLowerCase()
.startsWith(filterVal.substring(0, filterVal.length - 1))
);
return (user.display_name || user.email)
.toLowerCase()
.startsWith(filterVal.substring(0, filterVal.length - 1));
}
return (user.display_name || user.email)

Loading…
Cancel
Save