Skip to content

Commit d124189

Browse files
committed
fix(apollo): handle flat and wrapped contact response shapes
1 parent 3952c4e commit d124189

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

apps/sim/tools/apollo/contact_create.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,13 @@ export const apolloContactCreateTool: ToolConfig<
170170
}
171171

172172
const data = await response.json()
173+
const contact = data?.contact ?? (data?.id ? data : null)
173174

174175
return {
175176
success: true,
176177
output: {
177-
contact: data.contact ?? null,
178-
created: !!data.contact,
178+
contact,
179+
created: !!contact,
179180
},
180181
}
181182
},

apps/sim/tools/apollo/contact_update.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,13 @@ export const apolloContactUpdateTool: ToolConfig<
170170
}
171171

172172
const data = await response.json()
173+
const contact = data?.contact ?? (data?.id ? data : null)
173174

174175
return {
175176
success: true,
176177
output: {
177-
contact: data.contact ?? null,
178-
updated: !!data.contact,
178+
contact,
179+
updated: !!contact,
179180
},
180181
}
181182
},

0 commit comments

Comments
 (0)