(projectId: string, callback: (...args: any[]) => Promise<void>)
| 1 | import { prisma } from "../db"; |
| 2 | |
| 3 | export async function sendToOwner(projectId: string, callback: (...args: any[]) => Promise<void>) { |
| 4 | const owner = await prisma.projectUser.findFirst({ |
| 5 | where: { |
| 6 | projectId: projectId, |
| 7 | role: "OWNER", |
| 8 | }, |
| 9 | select: { |
| 10 | user: { |
| 11 | select: { |
| 12 | email: true, |
| 13 | }, |
| 14 | }, |
| 15 | }, |
| 16 | }); |
| 17 | |
| 18 | if (owner?.user.email) { |
| 19 | await callback(owner.user.email); |
| 20 | } |
| 21 | } |
no outgoing calls
no test coverage detected