import { prisma } from "@calcom/prisma";
import type { TrpcSessionUser } from "../../../trpc";
type AdminGetUnverifiedOptions = {
ctx: {
user: NonNullable<TrpcSessionUser>;
};
export const adminGetUnverifiedHandler = async ({ ctx }: AdminGetUnverifiedOptions) => {
const unVerifiedTeams = await prisma.team.findMany({
where: {
AND: [
{
metadata: {
path: ["isOrganization"],
equals: true,
},
path: ["isOrganizationVerified"],
equals: false,
],
select: {
id: true,
name: true,
slug: true,
members: {
role: "OWNER",
user: {
email: true,
});
return unVerifiedTeams;
export default adminGetUnverifiedHandler;