Skip to content

Commit a2334e3

Browse files
Update components/close/actions/update-lead/update-lead.mjs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 0f2c03b commit a2334e3

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

components/close/actions/update-lead/update-lead.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,17 @@ export default {
7171
const response = await this.close.updateLead({
7272
leadId: this.lead,
7373
data: {
74-
name: this.name,
75-
url: this.url,
76-
status_id: this.statusId,
77-
contacts: utils.parseArray(this.contacts),
78-
addresses: utils.parseArray(this.addresses),
74+
const response = await this.close.updateLead({
75+
leadId: this.lead,
76+
data: {
77+
...(this.name && { name: this.name }),
78+
...(this.url && { url: this.url }),
79+
...(this.statusId && { status_id: this.statusId }),
80+
...(this.contacts && { contacts: utils.parseArray(this.contacts) }),
81+
...(this.addresses && { addresses: utils.parseArray(this.addresses) }),
82+
...moreFields,
83+
},
84+
});
7985
...moreFields,
8086
},
8187
});

0 commit comments

Comments
 (0)