Add search Mode for mysql.

This commit is contained in:
Brian Cao committed 2023-08-15 10:57:25 -07:00
1 parent 8f542ed998
commit 203f4e8e03
5 files changed
+32 -11

No files matched your search

+3 -1
View File
@@ -41,6 +41,8 @@ export async function getUsers(
options?: { include?: Prisma.UserInclude },
): Promise<FilterResult<User[]>> {
const { teamId, filter, filterType = USER_FILTER_TYPES.all } = UserSearchFilter;
const mode = prisma.getSearchMode();
const where: Prisma.UserWhereInput = {
...(teamId && {
teamUser: {
@@ -57,7 +59,7 @@ export async function getUsers(
filterType === USER_FILTER_TYPES.username) && {
username: {
startsWith: filter,
mode: 'insensitive',
...mode,
},
}),
},