mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Add search Mode for mysql.
This commit is contained in:
parent
8f542ed998
commit
203f4e8e03
5 changed files with 32 additions and 11 deletions
|
|
@ -86,6 +86,8 @@ export async function getTeams(
|
|||
options?: { include?: Prisma.TeamInclude },
|
||||
): Promise<FilterResult<Team[]>> {
|
||||
const { userId, filter, filterType = TEAM_FILTER_TYPES.all } = TeamSearchFilter;
|
||||
const mode = prisma.getSearchMode();
|
||||
|
||||
const where: Prisma.TeamWhereInput = {
|
||||
...(userId && {
|
||||
teamUser: {
|
||||
|
|
@ -97,7 +99,7 @@ export async function getTeams(
|
|||
OR: [
|
||||
{
|
||||
...((filterType === TEAM_FILTER_TYPES.all || filterType === TEAM_FILTER_TYPES.name) && {
|
||||
name: { startsWith: filter, mode: 'insensitive' },
|
||||
name: { startsWith: filter, ...mode },
|
||||
}),
|
||||
},
|
||||
{
|
||||
|
|
@ -109,7 +111,7 @@ export async function getTeams(
|
|||
user: {
|
||||
username: {
|
||||
startsWith: filter,
|
||||
mode: 'insensitive',
|
||||
...mode,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue