28 lines
541 B
TypeScript
28 lines
541 B
TypeScript
import prisma from "@calcom/prisma";
|
|
|
|
export class AttributeRepository {
|
|
static async findManyByNamesAndOrgIdIncludeOptions({
|
|
attributeNames,
|
|
orgId,
|
|
}: {
|
|
attributeNames: string[];
|
|
orgId: number;
|
|
}) {
|
|
return prisma.attribute.findMany({
|
|
where: {
|
|
name: { in: attributeNames, mode: "insensitive" },
|
|
teamId: orgId,
|
|
},
|
|
include: {
|
|
options: {
|
|
select: {
|
|
id: true,
|
|
value: true,
|
|
slug: true,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
}
|
|
}
|