MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / cancelInvite

Function cancelInvite

packages/web/src/features/userManagement/actions.ts:443–467  ·  view source on GitHub ↗
(inviteId: string)

Source from the content-addressed store, hash-verified

441 ));
442
443export 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
470export const getOrgMembers = async () => sew(() =>

Callers 1

InvitesListFunction · 0.90

Calls 4

sewFunction · 0.90
withAuthFunction · 0.90
withMinimumOrgRoleFunction · 0.90
notFoundFunction · 0.90

Tested by

no test coverage detected