mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57: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
|
|
@ -30,6 +30,7 @@ export async function getWebsites(
|
|||
filter,
|
||||
filterType = WEBSITE_FILTER_TYPES.all,
|
||||
} = WebsiteSearchFilter;
|
||||
const mode = prisma.getSearchMode();
|
||||
|
||||
const where: Prisma.WebsiteWhereInput = {
|
||||
...(teamId && {
|
||||
|
|
@ -79,13 +80,13 @@ export async function getWebsites(
|
|||
{
|
||||
...((filterType === WEBSITE_FILTER_TYPES.all ||
|
||||
filterType === WEBSITE_FILTER_TYPES.name) && {
|
||||
name: { startsWith: filter, mode: 'insensitive' },
|
||||
name: { startsWith: filter, ...mode },
|
||||
}),
|
||||
},
|
||||
{
|
||||
...((filterType === WEBSITE_FILTER_TYPES.all ||
|
||||
filterType === WEBSITE_FILTER_TYPES.domain) && {
|
||||
domain: { startsWith: filter, mode: 'insensitive' },
|
||||
domain: { startsWith: filter, ...mode },
|
||||
}),
|
||||
},
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue