Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix Prisma text search with MySQL.

Maxime-J4930c4439dae
diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts
index 3831d836b..31a843517 100644
--- a/src/lib/prisma.ts
+++ b/src/lib/prisma.ts
@@ -198,14 +198,14 @@ async function pagedQuery<T>(model: string, criteria: T, filters: SearchFilter)
return { data, count, page: +page, pageSize: size, orderBy };
}
-function getQueryMode(): Prisma.QueryMode {
+function getQueryMode(): { mode?: Prisma.QueryMode } {
const db = getDatabaseType();
if (db === POSTGRESQL) {
- return 'insensitive';
+ return { mode: 'insensitive' };
}
- return 'default';
+ return {};
}
function getSearchParameters(query: string, filters: { [key: string]: any }[]) {
@@ -220,7 +220,7 @@ function getSearchParameters(query: string, filters: { [key: string]: any }[]) {
typeof value === 'string'
? {
[value]: query,
- mode,
+ ...mode,
}
: parseFilter(value),
};