mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 00:55:37 +01:00
segments implementation and migration update. update getRequestFilters to include filter groups.
This commit is contained in:
parent
1ccc8a1a86
commit
f61421b742
16 changed files with 188 additions and 23 deletions
|
|
@ -1,4 +1,5 @@
|
|||
export * from '@/queries/prisma/report';
|
||||
export * from '@/queries/prisma/segment';
|
||||
export * from '@/queries/prisma/team';
|
||||
export * from '@/queries/prisma/teamUser';
|
||||
export * from '@/queries/prisma/user';
|
||||
|
|
|
|||
|
|
@ -13,6 +13,18 @@ export async function getSegment(segmentId: string): Promise<Segment> {
|
|||
});
|
||||
}
|
||||
|
||||
export async function getWebsiteSegment(websiteId: string, name: string): Promise<Segment> {
|
||||
return prisma.client.segment.findFirst({
|
||||
where: { websiteId, name },
|
||||
});
|
||||
}
|
||||
|
||||
export async function getWebsiteSegments(websiteId: string, type: string): Promise<Segment[]> {
|
||||
return prisma.client.Segment.findMany({
|
||||
where: { websiteId, type },
|
||||
});
|
||||
}
|
||||
|
||||
export async function createSegment(data: Prisma.SegmentUncheckedCreateInput): Promise<Segment> {
|
||||
return prisma.client.Segment.create({ data });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue