Skip to content

Commit 81c3d86

Browse files
authored
Fixing hs_timestamp (#109)
1 parent 0288102 commit 81c3d86

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vesselapi/integrations",
3-
"version": "0.0.76",
3+
"version": "0.0.77",
44
"description": "Vessel integrations",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

src/platforms/hubspot/client.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,19 @@ const makeClient = () => {
121121
const createObject = <TInput extends Record<string, unknown>, TOutput>(
122122
module: HubspotModule | `objects/${HubspotModule}`,
123123
schema: z.ZodSchema,
124+
properties?: string[],
124125
): requestFunctionType<TInput, TOutput> =>
125126
request((body: TInput) => ({
126127
url: `/crm/${API_VERSION}/${module}/`,
127128
method: 'POST',
128129
schema,
129130
json: {
130-
properties: {
131-
hs_timestamp: new Date().toISOString(),
131+
properties: shake({
132+
hs_timestamp: properties?.includes('hs_timestamp')
133+
? new Date().toISOString()
134+
: undefined,
132135
...shake(body),
133-
},
136+
}),
134137
},
135138
}));
136139

@@ -189,7 +192,7 @@ const makeClient = () => {
189192
listResponseSchema(schema),
190193
properties,
191194
),
192-
create: createObject<TCreate, TOutput>(module, schema),
195+
create: createObject<TCreate, TOutput>(module, schema, properties),
193196
update: updateObject<TUpdate, TOutput>(module, schema),
194197
delete: deleteObject(module, schema),
195198
batchRead: batchReadObject<ListOutput<TOutput>>(

0 commit comments

Comments
 (0)