Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions consumer/src/services/ConsumerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class ConsumerService {
throw e;
})
} else {
// don't update the company of the lead if it is updating existing lead
delete leadData.Company;
// if lead does exists update it with project data
if (lead.IsConverted != true && !_.isEmpty(leadData)) {
return SalesforceService.updateObject(lead.Id, 'Lead', leadData, accessToken, instanceUrl);
Expand Down
2 changes: 2 additions & 0 deletions consumer/src/services/LeadService.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const postLeadSchema = Joi.object().keys({
firstName: Joi.string().required(),
lastName: Joi.string().required(),
businessEmail: Joi.string().email().required(),
businessPhone: Joi.string().optional(),
title: Joi.string().required(),
companyName: Joi.string().required(),
companySize: Joi.string().required(),
Expand Down Expand Up @@ -43,6 +44,7 @@ class LeadService {
FirstName: user.firstName,
LastName: user.lastName,
Email: user.businessEmail,
Phone: user.businessPhone ? user.businessPhone : '',
LeadSource: leadSource,
Company: user.companyName,
No_of_Employees__c: user.companySize,
Expand Down
3 changes: 2 additions & 1 deletion consumer/test/ConsumerService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ describe('ConsumerService', () => {
LastName: 'doe',
Email: 'jd@example.com',
LeadSource: 'Connect',
Company: 'Unknown',
// should not update the Company when the lead already exists
// Company: 'Unknown',
OwnerId: config.ownerId,
TC_Handle__c: 'jdoe',
TC_Connect_Project_Id__c: 1,
Expand Down