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 bounty.name field type

Steven Tey53fe04c2e5ac
diff --git a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
index 40b118c5ab..47a6aa7390 100644
--- a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
+++ b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
@@ -101,7 +101,7 @@ export const PATCH = withWorkspace(
id: bounty.id,
},
data: {
- name,
+ name: name ?? undefined,
description,
startsAt: startsAt!, // Can remove the ! when we're on a newer TS version (currently 5.4.4)
endsAt,
diff --git a/apps/web/lib/zod/schemas/bounties.ts b/apps/web/lib/zod/schemas/bounties.ts
index ac940f8689..7d1c237d90 100644
--- a/apps/web/lib/zod/schemas/bounties.ts
+++ b/apps/web/lib/zod/schemas/bounties.ts
@@ -28,7 +28,7 @@ export const createBountySchema = z.object({
.string()
.trim()
.max(100, "Name must be less than 100 characters")
- .optional(),
+ .nullish(),
description: z
.string()
.trim()