Skip to content

Commit 2e24aeb

Browse files
committed
fix(google-contacts): throw error when no update fields provided
1 parent 6d831cc commit 2e24aeb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/sim/tools/google_contacts/update.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ export const updateTool: ToolConfig<GoogleContactsUpdateParams, GoogleContactsUp
102102
if (params.organization || params.jobTitle) updateFields.push('organizations')
103103
if (params.notes) updateFields.push('biographies')
104104

105-
const updatePersonFields = updateFields.length > 0 ? updateFields.join(',') : 'names'
105+
if (updateFields.length === 0) {
106+
throw new Error('At least one field to update must be provided')
107+
}
108+
109+
const updatePersonFields = updateFields.join(',')
106110

107111
return `${PEOPLE_API_BASE}/${params.resourceName}:updateContact?updatePersonFields=${updatePersonFields}&personFields=${DEFAULT_PERSON_FIELDS}`
108112
},

0 commit comments

Comments
 (0)