Skip to content

Commit 83eccb9

Browse files
committed
login-as: when both first and last name are search, use AND not OR
1 parent bf9a559 commit 83eccb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/src/services/PersonService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const searchPersons = async (userQuery) => {
191191
const firstName = userQuery.split(' ')[0]
192192
const lastName = userQuery.split(' ')[1]
193193
query = qb => qb.where('firstname', 'iLIKE', `%${firstName}%`)
194-
.orWhere('lastname', 'iLIKE', `%${lastName}%`)
194+
.andWhere('lastname', 'iLIKE', `%${lastName}%`)
195195
} else {
196196
query = qb => qb.where('email', 'iLIKE', `%${userQuery}%`)
197197
.orWhere('firstname', 'iLIKE', `%${userQuery}%`)

0 commit comments

Comments
 (0)