Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

allow reopening rejected submissions

Steven Tey5d73dd225366
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-row-menu.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-row-menu.tsx
index f179e09838..00fadf2248 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-row-menu.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/[bountyId]/bounty-submission-row-menu.tsx
@@ -80,7 +80,7 @@ export function BountySubmissionRowMenu({
}}
/>
- {submission.status === "submitted" && (
+ {["submitted", "rejected"].includes(submission.status) && (
<MenuItem
icon={ArrowsOppositeDirectionX}
label="Reopen submission"
diff --git a/apps/web/lib/actions/partners/reopen-bounty-submission.ts b/apps/web/lib/actions/partners/reopen-bounty-submission.ts
index 2cfebcf069..b052c00b7a 100644
--- a/apps/web/lib/actions/partners/reopen-bounty-submission.ts
+++ b/apps/web/lib/actions/partners/reopen-bounty-submission.ts
@@ -40,8 +40,8 @@ export const reopenBountySubmissionAction = authActionClient
throw new Error("Bounty submission does not belong to this program.");
}
- if (bountySubmission.status !== "submitted") {
- throw new Error("Bounty submission is not submitted yet.");
+ if (bountySubmission.status === "approved") {
+ throw new Error("Bounty submission has already been approved.");
}
await prisma.bountySubmission.update({
@@ -50,6 +50,10 @@ export const reopenBountySubmissionAction = authActionClient
},
data: {
status: "draft",
+ completedAt: null,
+ reviewedAt: null,
+ rejectionNote: null,
+ rejectionReason: null,
},
});