mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Website: Update save-questionnaire-progress (#18625)
Related to https://github.com/fleetdm/confidential/issues/6357 Changes: - Updated `save-questionnaire-progress` to only call `sails.helpers.salesforce.updateOrCreateContactAndAccount` is called when a user's `psychologicalStage` changes.
This commit is contained in:
parent
b09d34fa4b
commit
7259ec6473
1 changed files with 11 additions and 10 deletions
|
|
@ -174,16 +174,17 @@ module.exports = {
|
|||
|
||||
}//fi
|
||||
|
||||
|
||||
|
||||
await sails.helpers.salesforce.updateOrCreateContactAndAccount.with({
|
||||
emailAddress: this.req.me.emailAddress,
|
||||
firstName: this.req.me.firstName,
|
||||
lastName: this.req.me.lastName,
|
||||
primaryBuyingSituation: primaryBuyingSituation === 'eo-security' ? 'Endpoint operations - Security' : primaryBuyingSituation === 'eo-it' ? 'Endpoint operations - IT' : primaryBuyingSituation === 'mdm' ? 'Device management (MDM)' : primaryBuyingSituation === 'vm' ? 'Vulnerability management' : undefined,
|
||||
organization: this.req.me.organization,
|
||||
psychologicalStage,
|
||||
});
|
||||
// Only update CRM records if the user's psychological stage changes.
|
||||
if(currentStep !== userRecord.currentStep){
|
||||
await sails.helpers.salesforce.updateOrCreateContactAndAccount.with({
|
||||
emailAddress: this.req.me.emailAddress,
|
||||
firstName: this.req.me.firstName,
|
||||
lastName: this.req.me.lastName,
|
||||
primaryBuyingSituation: primaryBuyingSituation === 'eo-security' ? 'Endpoint operations - Security' : primaryBuyingSituation === 'eo-it' ? 'Endpoint operations - IT' : primaryBuyingSituation === 'mdm' ? 'Device management (MDM)' : primaryBuyingSituation === 'vm' ? 'Vulnerability management' : undefined,
|
||||
organization: this.req.me.organization,
|
||||
psychologicalStage,
|
||||
});
|
||||
}
|
||||
// TODO: send all other answers to Salesforce (when there are fields for them)
|
||||
|
||||
// await sails.helpers.http.post.with({
|
||||
|
|
|
|||
Loading…
Reference in a new issue