mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Fix Prisma text search with MySQL.
This commit is contained in:
parent
75d2e3af41
commit
4930c4439d
1 changed files with 4 additions and 4 deletions
|
|
@ -198,14 +198,14 @@ async function pagedQuery<T>(model: string, criteria: T, filters: SearchFilter)
|
||||||
return { data, count, page: +page, pageSize: size, orderBy };
|
return { data, count, page: +page, pageSize: size, orderBy };
|
||||||
}
|
}
|
||||||
|
|
||||||
function getQueryMode(): Prisma.QueryMode {
|
function getQueryMode(): { mode?: Prisma.QueryMode } {
|
||||||
const db = getDatabaseType();
|
const db = getDatabaseType();
|
||||||
|
|
||||||
if (db === POSTGRESQL) {
|
if (db === POSTGRESQL) {
|
||||||
return 'insensitive';
|
return { mode: 'insensitive' };
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'default';
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSearchParameters(query: string, filters: { [key: string]: any }[]) {
|
function getSearchParameters(query: string, filters: { [key: string]: any }[]) {
|
||||||
|
|
@ -220,7 +220,7 @@ function getSearchParameters(query: string, filters: { [key: string]: any }[]) {
|
||||||
typeof value === 'string'
|
typeof value === 'string'
|
||||||
? {
|
? {
|
||||||
[value]: query,
|
[value]: query,
|
||||||
mode,
|
...mode,
|
||||||
}
|
}
|
||||||
: parseFilter(value),
|
: parseFilter(value),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue