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.

fix type error

Steven Tey4c2171fb8630
diff --git a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
index 459f63564a..a07fe87a39 100644
--- a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
+++ b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
@@ -54,7 +54,7 @@ export const PATCH = withWorkspace(async ({ workspace, params, req }) => {
groupIds,
} = updateBountySchema.parse(await parseRequestBody(req));
- if (endsAt && endsAt < startsAt) {
+ if (startsAt && endsAt && endsAt < startsAt) {
throw new DubApiError({
message: "endsAt must be on or after startsAt.",
code: "bad_request",