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.

Update validate-bounty.ts

Kiran K19a3833124f6
diff --git a/apps/web/lib/api/bounties/validate-bounty.ts b/apps/web/lib/api/bounties/validate-bounty.ts
index 2e69a088f9..9aaf92ce4d 100644
--- a/apps/web/lib/api/bounties/validate-bounty.ts
+++ b/apps/web/lib/api/bounties/validate-bounty.ts
@@ -24,6 +24,14 @@ export function validateBounty({
}
if (submissionsOpenAt) {
+ if (!endsAt) {
+ throw new DubApiError({
+ message:
+ "An end date is required to determine when the submission window opens.",
+ code: "bad_request",
+ });
+ }
+
if (submissionsOpenAt < startsAt) {
throw new DubApiError({
message:
@@ -32,7 +40,7 @@ export function validateBounty({
});
}
- if (endsAt && submissionsOpenAt > endsAt) {
+ if (submissionsOpenAt > endsAt) {
throw new DubApiError({
message:
"Bounty submissions open date (submissionsOpenAt) must be on or before end date (endsAt).",