1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-24 20:19:10 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Hubert
cde490a59b Solved the typescript error. 2023-08-17 10:51:14 -03:00
Hubert
eefebb2444 lowercase the searchQuery to turns the search for users case-insensitive, in postgresql and sqlite. 2023-08-16 15:29:44 -03:00
Hubert
f92ca399b8 Removes the trim. 2023-08-16 15:00:38 -03:00
Hubert
c30f895db9 Just added a trim in the searchQuery. 2023-08-16 14:44:14 -03:00

View File

@@ -100,7 +100,7 @@ router.get('admin/users', async (_path: SubPath, ctx: AppContext) => {
await userModel.checkIfAllowed(ctx.joplin.owner, AclAction.List);
const showDisabled = ctx.query.show_disabled === '1';
const searchQuery = ctx.query.query || '';
const searchQuery = (ctx.query.query && ctx.query.query.toString().toLowerCase()) || '';
const pagination = makeTablePagination(ctx.query, 'full_name', PaginationOrderDir.ASC);
pagination.limit = 1000;
@@ -112,7 +112,9 @@ router.get('admin/users', async (_path: SubPath, ctx: AppContext) => {
if (searchQuery) {
void query.where(qb => {
void qb.whereRaw('full_name like ?', [`%${searchQuery}%`]).orWhereRaw('email like ?', [`%${searchQuery}%`]);
void qb
.whereRaw('lower(full_name) like ?', [`%${searchQuery}%`])
.orWhereRaw('lower(email) like ?', [`%${searchQuery}%`]);
});
}