MCPcopy Create free account
hub / github.com/code100x/cms / deleteBounty

Function deleteBounty

src/actions/bounty/adminActions.ts:73–87  ·  view source on GitHub ↗
(bountyId: string)

Source from the content-addressed store, hash-verified

71}
72
73export async function deleteBounty(bountyId: string) {
74 const session = await getServerSession(authOptions);
75
76 if (!session || !session.user || session.user.role !== ROLES.ADMIN) {
77 return { error: 'Unauthorized or insufficient permissions' };
78 }
79 try {
80 const deleteBounty = await prisma.bountySubmission.delete({
81 where: { id: bountyId },
82 });
83 return { success: !!deleteBounty };
84 } catch (e) {
85 return { error: 'An error occurred while approving the bounty.' };
86 }
87}
88
89export async function confirmBounty(bountyId: string, amount: number) {
90 const session = await getServerSession(authOptions);

Callers 1

handleDeleteFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected