(inviteId: string)
| 441 | )); |
| 442 | |
| 443 | export const cancelInvite = async (inviteId: string): Promise<{ success: boolean } | ServiceError> => sew(() => |
| 444 | withAuth(async ({ org, role, prisma }) => |
| 445 | withMinimumOrgRole(role, OrgRole.OWNER, async () => { |
| 446 | const invite = await prisma.invite.findUnique({ |
| 447 | where: { |
| 448 | id: inviteId, |
| 449 | orgId: org.id, |
| 450 | }, |
| 451 | }); |
| 452 | |
| 453 | if (!invite) { |
| 454 | return notFound(); |
| 455 | } |
| 456 | |
| 457 | await prisma.invite.delete({ |
| 458 | where: { |
| 459 | id: inviteId, |
| 460 | }, |
| 461 | }); |
| 462 | |
| 463 | return { |
| 464 | success: true, |
| 465 | } |
| 466 | }) |
| 467 | )); |
| 468 | |
| 469 | |
| 470 | export const getOrgMembers = async () => sew(() => |
no test coverage detected