finish segments, update migration from filters to parameters

This commit is contained in:
Francis Cao 2025-06-20 10:27:57 -07:00
parent 8408bbd25c
commit 5ffafc71fc
10 changed files with 25 additions and 16 deletions

View file

@ -13,9 +13,13 @@ export async function getSegment(segmentId: string): Promise<Segment> {
});
}
export async function getWebsiteSegment(websiteId: string, name: string): Promise<Segment> {
export async function getWebsiteSegment(
websiteId: string,
type: string,
name: string,
): Promise<Segment> {
return prisma.client.segment.findFirst({
where: { websiteId, name },
where: { websiteId, type, name },
});
}