Skip to content

Commit 152fdce

Browse files
add first and last name searching
1 parent cb9fd72 commit 152fdce

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

backend/src/modules/search/repository/search.repository.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ export async function findUsers(searchText: string, limit: number, offset: numbe
1515
profile_image
1616
FROM users
1717
WHERE
18-
username ILIKE $1
19-
ORDER BY username
18+
username ILIKE $1 OR
19+
first_name ILIKE $1 OR
20+
last_name ILIKE $1
21+
ORDER BY first_name, last_name
2022
LIMIT $2 OFFSET $3;
2123
`;
2224
const params = [`%${searchText}%`, limit, offset];

0 commit comments

Comments
 (0)