Skip to content

Commit 391b06b

Browse files
committed
fix(apollo): don't clobber user contact_attributes in migration; simplify task_create created flag
1 parent 69aa833 commit 391b06b

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

apps/sim/blocks/blocks/apollo.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,15 +1004,23 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
10041004

10051005
if (params.operation === 'contact_bulk_update') {
10061006
const { ids, attributes } = splitBulkUpdateInput(parsedParams.contacts)
1007-
if (attributes) parsedParams.contact_attributes = attributes
1008-
if (ids && !attributes) parsedParams.contact_ids = ids
1007+
if (attributes && parsedParams.contact_attributes === undefined) {
1008+
parsedParams.contact_attributes = attributes
1009+
}
1010+
if (ids && !attributes && parsedParams.contact_ids === undefined) {
1011+
parsedParams.contact_ids = ids
1012+
}
10091013
parsedParams.contacts = undefined
10101014
}
10111015

10121016
if (params.operation === 'account_bulk_update') {
10131017
const { ids, attributes } = splitBulkUpdateInput(parsedParams.accounts)
1014-
if (attributes) parsedParams.account_attributes = attributes
1015-
if (ids && !attributes) parsedParams.account_ids = ids
1018+
if (attributes && parsedParams.account_attributes === undefined) {
1019+
parsedParams.account_attributes = attributes
1020+
}
1021+
if (ids && !attributes && parsedParams.account_ids === undefined) {
1022+
parsedParams.account_ids = ids
1023+
}
10161024
parsedParams.accounts = undefined
10171025
if (rest.account_bulk_update_name) {
10181026
parsedParams.name = rest.account_bulk_update_name

apps/sim/tools/apollo/task_create.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,12 @@ export const apolloTaskCreateTool: ToolConfig<ApolloTaskCreateParams, ApolloTask
8888

8989
const data = await response.json().catch(() => null)
9090
const tasks = Array.isArray(data?.tasks) ? data.tasks : []
91-
const created =
92-
data === true ||
93-
data?.success === true ||
94-
tasks.length > 0 ||
95-
(response.status >= 200 && response.status < 300)
9691

9792
return {
9893
success: true,
9994
output: {
10095
tasks,
101-
created,
96+
created: true,
10297
},
10398
}
10499
},

0 commit comments

Comments
 (0)