Updated segment handling.

This commit is contained in:
Mike Cao 2025-07-31 02:33:35 -07:00
parent 554c627a58
commit fba7e12c36
13 changed files with 59 additions and 90 deletions

View file

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