mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
Add team reports.
This commit is contained in:
parent
f35a9f0950
commit
69389ebcd5
@ -37,6 +37,7 @@ export default async (
|
||||
page,
|
||||
filter,
|
||||
pageSize: +pageSize || null,
|
||||
includeTeams: true,
|
||||
});
|
||||
|
||||
return ok(res, data);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Prisma, Report } from '@prisma/client';
|
||||
import { REPORT_FILTER_TYPES } from 'lib/constants';
|
||||
import prisma from 'lib/prisma';
|
||||
import { FilterResult, ReportSearchFilter, ReportSearchFilterType, SearchFilter } from 'lib/types';
|
||||
import { FilterResult, ReportSearchFilter } from 'lib/types';
|
||||
|
||||
export async function createReport(data: Prisma.ReportUncheckedCreateInput): Promise<Report> {
|
||||
return prisma.client.report.create({ data });
|
||||
@ -155,7 +155,7 @@ export async function getReports(
|
||||
|
||||
export async function getReportsByUserId(
|
||||
userId: string,
|
||||
filter: SearchFilter<ReportSearchFilterType>,
|
||||
filter: ReportSearchFilter,
|
||||
): Promise<FilterResult<Report[]>> {
|
||||
return getReports(
|
||||
{ userId, ...filter },
|
||||
@ -174,7 +174,7 @@ export async function getReportsByUserId(
|
||||
|
||||
export async function getReportsByWebsiteId(
|
||||
websiteId: string,
|
||||
filter: SearchFilter<ReportSearchFilterType>,
|
||||
filter: ReportSearchFilter,
|
||||
): Promise<FilterResult<Report[]>> {
|
||||
return getReports({ websiteId, ...filter });
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Prisma, Team } from '@prisma/client';
|
||||
import prisma from 'lib/prisma';
|
||||
import { ROLES, TEAM_FILTER_TYPES } from 'lib/constants';
|
||||
import { uuid } from 'lib/crypto';
|
||||
import { FilterResult, TeamSearchFilter, TeamSearchFilterType, SearchFilter } from 'lib/types';
|
||||
import prisma from 'lib/prisma';
|
||||
import { FilterResult, TeamSearchFilter } from 'lib/types';
|
||||
|
||||
export interface GetTeamOptions {
|
||||
includeTeamUser?: boolean;
|
||||
@ -142,7 +142,7 @@ export async function getTeams(
|
||||
|
||||
export async function getTeamsByUserId(
|
||||
userId: string,
|
||||
filter?: SearchFilter<TeamSearchFilterType>,
|
||||
filter?: TeamSearchFilter,
|
||||
): Promise<FilterResult<Team[]>> {
|
||||
return getTeams(
|
||||
{ userId, ...filter },
|
||||
|
Loading…
Reference in New Issue
Block a user