mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Updated types.
This commit is contained in:
parent
1e0c177fe6
commit
6b9c83381c
12 changed files with 40 additions and 43 deletions
|
|
@ -31,7 +31,7 @@ export async function getReports(
|
|||
): Promise<FilterResult<Report[]>> {
|
||||
const { query, userId, websiteId, includeTeams } = params;
|
||||
|
||||
const mode = prisma.getSearchMode();
|
||||
const mode = prisma.getQueryMode();
|
||||
|
||||
const where: Prisma.ReportWhereInput = {
|
||||
userId,
|
||||
|
|
@ -66,26 +66,26 @@ export async function getReports(
|
|||
{
|
||||
name: {
|
||||
contains: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: {
|
||||
contains: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: {
|
||||
contains: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
{
|
||||
user: {
|
||||
username: {
|
||||
contains: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -93,7 +93,7 @@ export async function getReports(
|
|||
website: {
|
||||
name: {
|
||||
contains: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -101,7 +101,7 @@ export async function getReports(
|
|||
website: {
|
||||
domain: {
|
||||
contains: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ export async function getTeams(
|
|||
options?: { include?: Prisma.TeamInclude },
|
||||
): Promise<FilterResult<Team[]>> {
|
||||
const { userId, query } = filters;
|
||||
const mode = prisma.getSearchMode();
|
||||
const mode = prisma.getQueryMode();
|
||||
|
||||
const where: Prisma.TeamWhereInput = {
|
||||
...(userId && {
|
||||
|
|
@ -98,7 +98,7 @@ export async function getTeams(
|
|||
AND: {
|
||||
OR: [
|
||||
{
|
||||
name: { startsWith: query, ...mode },
|
||||
name: { startsWith: query, mode },
|
||||
},
|
||||
{
|
||||
teamUser: {
|
||||
|
|
@ -107,7 +107,7 @@ export async function getTeams(
|
|||
user: {
|
||||
username: {
|
||||
startsWith: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export async function getUsers(
|
|||
options?: { include?: Prisma.UserInclude },
|
||||
): Promise<FilterResult<User[]>> {
|
||||
const { teamId, query } = params;
|
||||
const mode = prisma.getSearchMode();
|
||||
const mode = prisma.getQueryMode();
|
||||
|
||||
const where: Prisma.UserWhereInput = {
|
||||
...(teamId && {
|
||||
|
|
@ -61,7 +61,7 @@ export async function getUsers(
|
|||
{
|
||||
username: {
|
||||
contains: query,
|
||||
...mode,
|
||||
mode,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export async function getWebsites(
|
|||
options?: { include?: Prisma.WebsiteInclude },
|
||||
): Promise<FilterResult<Website[]>> {
|
||||
const { userId, teamId, includeTeams, onlyTeams, query } = filters;
|
||||
const mode = prisma.getSearchMode();
|
||||
const mode = prisma.getQueryMode();
|
||||
|
||||
const where: Prisma.WebsiteWhereInput = {
|
||||
...(teamId && {
|
||||
|
|
@ -72,10 +72,10 @@ export async function getWebsites(
|
|||
OR: query
|
||||
? [
|
||||
{
|
||||
name: { contains: query, ...mode },
|
||||
name: { contains: query, mode },
|
||||
},
|
||||
{
|
||||
domain: { contains: query, ...mode },
|
||||
domain: { contains: query, mode },
|
||||
},
|
||||
]
|
||||
: [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue