Skip to content

Commit e6524a1

Browse files
authored
fix: hubspot deal closedate empty string transform to null (#258)
1 parent 517471a commit e6524a1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vesselapi/integrations",
3-
"version": "1.0.42",
3+
"version": "1.0.43",
44
"description": "Vessel integrations",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

src/platforms/hubspot/schemas.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,15 @@ export type HubspotContactUpdate = z.infer<
204204
const dealPropertiesSchema = z.object({
205205
amount: z.union([z.string(), z.number()]).nullable(),
206206
dealname: z.string().nullable(),
207-
closedate: custom.date().nullable(),
207+
closedate: custom
208+
.date()
209+
.or(
210+
z
211+
.string()
212+
.max(0)
213+
.transform(() => null),
214+
)
215+
.nullable(),
208216
dealstage: z.string().nullable(),
209217
hs_deal_stage_probability: z.union([z.string(), z.number()]).nullable(),
210218
hs_projected_amount: z.union([z.string(), z.number()]).nullable(),

0 commit comments

Comments
 (0)