Browse Source

fix: update org users search query

pull/7413/head
Ramesh Mane 11 months ago
parent
commit
8e045ef891
  1. 20
      packages/nocodb/src/models/User.ts

20
packages/nocodb/src/models/User.ts

@ -229,7 +229,25 @@ export default class User implements UserType {
.as('projectsCount'),
);
if (query) {
queryBuilder.where('email', 'like', `%${query.toLowerCase?.()}%`);
queryBuilder
.where(function () {
this.where('email', 'like', `%${query.toLowerCase?.()}%`).orWhere(
'display_name',
'like',
`%${query.toLowerCase?.()}%`,
);
})
.where(function () {
this.where(function () {
this.whereNotNull('display_name')
.andWhereNot('display_name', '')
.andWhere('display_name', 'like', `%${query.toLowerCase?.()}%`);
}).orWhere(function () {
this.whereNull('display_name')
.orWhere('display_name', '')
.andWhere('email', 'like', `%${query.toLowerCase?.()}%`);
});
});
}
return queryBuilder;

Loading…
Cancel
Save