mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Don't overwrite Close.io Lead Origin custom field
This commit is contained in:
parent
bd87783631
commit
0b3c7d3189
1 changed files with 5 additions and 2 deletions
|
@ -91,9 +91,12 @@ function updateCloseLead(zpContact, existingLead, done) {
|
|||
// console.log(`DEBUG: updateCloseLead ${existingLead.id} ${zpContact.email}`);
|
||||
const putData = {
|
||||
status: 'Contacted',
|
||||
'custom.lastUpdated': new Date(),
|
||||
'custom.Lead Origin': 'outbound campaign'
|
||||
'custom.lastUpdated': new Date()
|
||||
};
|
||||
const currentCustom = existingLead.custom || {};
|
||||
if (!currentCustom['Lead Origin']) {
|
||||
putData['custom.Lead Origin'] = 'outbound campaign';
|
||||
}
|
||||
const options = {
|
||||
uri: `https://${closeIoApiKey}:X@app.close.io/api/v1/lead/${existingLead.id}/`,
|
||||
body: JSON.stringify(putData)
|
||||
|
|
Loading…
Reference in a new issue