Skip to content

Commit 09b7ada

Browse files
committed
Revert close update-lead action to upstream master version
1 parent 2e27e83 commit 09b7ada

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,20 @@ export default {
6464
},
6565
},
6666
async run({ $ }) {
67+
const data = {};
68+
if (this.name) data.name = this.name;
69+
if (this.url) data.url = this.url;
70+
if (this.statusId) data.status_id = this.statusId;
71+
if (this.contacts) data.contacts = utils.parseArray(this.contacts);
72+
if (this.addresses) data.addresses = utils.parseArray(this.addresses);
6773
const moreFields = {};
6874
for (let key in this.moreFields) {
6975
moreFields[key] = utils.parseObject(this.moreFields[key]);
7076
}
7177
const response = await this.close.updateLead({
7278
leadId: this.lead,
7379
data: {
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-
});
80+
...data,
8581
...moreFields,
8682
},
8783
});

0 commit comments

Comments
 (0)