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.

final changes

Steven Teyaa66a4c8f67e
diff --git a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
index da1fca2e90..0af07052d0 100644
--- a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
+++ b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
@@ -187,12 +187,6 @@ export const DELETE = withWorkspace(
},
});
- await tx.bountySubmission.deleteMany({
- where: {
- bountyId,
- },
- });
-
if (bounty.workflowId) {
await tx.workflow.delete({
where: {
@@ -202,9 +196,6 @@ export const DELETE = withWorkspace(
}
});
- // TODO:
- // We should also delete the files submitted for the bounty from R2.
-
return NextResponse.json({ id: bountyId });
},
{
diff --git a/apps/web/lib/actions/partners/create-bounty-submission.ts b/apps/web/lib/actions/partners/create-bounty-submission.ts
index 65a7ad32e3..41f3f3c45b 100644
--- a/apps/web/lib/actions/partners/create-bounty-submission.ts
+++ b/apps/web/lib/actions/partners/create-bounty-submission.ts
@@ -68,9 +68,9 @@ export const createBountySubmissionAction = authPartnerActionClient
throw new Error("This bounty is not for this program.");
}
- // Validate the partner has not already submitted a bounty for this program
+ // Validate the partner has not already created a submission for this bounty
if (bounty.submissions.length > 0) {
- throw new Error("You have already submitted a bounty for this program.");
+ throw new Error("You have already created a submission for this bounty.");
}
if (bounty.groups.length > 0) {
diff --git a/apps/web/lib/actions/partners/upload-bounty-submission-file.ts b/apps/web/lib/actions/partners/upload-bounty-submission-file.ts
index 187ad701f8..d1c15c6e0f 100644
--- a/apps/web/lib/actions/partners/upload-bounty-submission-file.ts
+++ b/apps/web/lib/actions/partners/upload-bounty-submission-file.ts
@@ -64,9 +64,9 @@ export const uploadBountySubmissionFileAction = authPartnerActionClient
throw new Error("This bounty is not for this program.");
}
- // Validate the partner has not already submitted a bounty for this program
+ // Validate the partner has not already created a submission for this bounty
if (bounty.submissions.length > 0) {
- throw new Error("You have already submitted a bounty for this program.");
+ throw new Error("You have already created a submission for this bounty.");
}
if (bounty.groups.length > 0) {
diff --git a/apps/web/lib/api/bounties/get-bounty-with-details.ts b/apps/web/lib/api/bounties/get-bounty-with-details.ts
index e0ffac1817..2129e27734 100644
--- a/apps/web/lib/api/bounties/get-bounty-with-details.ts
+++ b/apps/web/lib/api/bounties/get-bounty-with-details.ts
@@ -25,7 +25,7 @@ export const getBountyWithDetails = async ({
(
SELECT COUNT(pe.partnerId)
FROM ProgramEnrollment pe
- WHERE pe.status IN ('approved', 'invited')
+ WHERE pe.programId = ${programId} AND pe.status IN ('approved', 'invited')
AND (
-- If bounty has specific groups, count only partners in those groups
EXISTS (
diff --git a/apps/web/lib/zod/schemas/partner-profile.ts b/apps/web/lib/zod/schemas/partner-profile.ts
index 8b95f7fd38..41dd42eae9 100644
--- a/apps/web/lib/zod/schemas/partner-profile.ts
+++ b/apps/web/lib/zod/schemas/partner-profile.ts
@@ -143,5 +143,6 @@ export const PartnerBountySchema = BountySchema.extend({
totalConversions: z.number(),
totalSales: z.number(),
totalSaleAmount: z.number(),
+ totalCommissions: z.number(),
}),
});