Skip to content

Commit ae40b0e

Browse files
committed
fix(apollo): reject ambiguous account/contact_ids + array-form attributes
1 parent ecd8e9a commit ae40b0e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

apps/sim/tools/apollo/account_bulk_update.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export const apolloAccountBulkUpdateTool: ToolConfig<
9999
'Apollo account bulk update with object-form account_attributes requires account_ids to identify which accounts to update.'
100100
)
101101
}
102+
if (body.account_ids && Array.isArray(body.account_attributes)) {
103+
throw new Error(
104+
'Apollo account bulk update cannot combine account_ids with array-form account_attributes. Use account_ids with name/owner_id (or object-form account_attributes), or use array-form account_attributes alone (each entry carries its own id).'
105+
)
106+
}
102107
if (params.async !== undefined) body.async = params.async
103108
return body
104109
},

apps/sim/tools/apollo/contact_bulk_update.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ export const apolloContactBulkUpdateTool: ToolConfig<
7878
'Apollo bulk update with object-form contact_attributes requires contact_ids to identify which contacts to update.'
7979
)
8080
}
81+
if (body.contact_ids && Array.isArray(body.contact_attributes)) {
82+
throw new Error(
83+
'Apollo contact bulk update cannot combine contact_ids with array-form contact_attributes. Use contact_ids with object-form contact_attributes for uniform updates, or use array-form contact_attributes alone (each entry carries its own id).'
84+
)
85+
}
8186
if (params.async !== undefined) body.async = params.async
8287
return body
8388
},

0 commit comments

Comments
 (0)