Skip to content

Commit

Permalink
fix(salesforce): add variable environment to disable SF requests
Browse files Browse the repository at this point in the history
  • Loading branch information
emile-bex committed Oct 25, 2023
1 parent d828e09 commit f1d40c5
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/contacts/contacts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,40 @@ export class ContactsService {
async sendCompanyContactToSalesforce(
contactCompanyFormDto: ContactCompanyFormDto
) {
return this.salesforceService.createOrUpdateCompanySalesforceLead(
contactCompanyFormDto
);
if (process.env.ENABLE_SF === 'true') {
return this.salesforceService.createOrUpdateCompanySalesforceLead(
contactCompanyFormDto
);
}
}

async sendCandidateContactToSalesforce(
contactCandidateFormDto: ContactCandidateFormDto
) {
return this.salesforceService.createOrUpdateContactCandidateSalesforceLead(
contactCandidateFormDto
);
if (process.env.ENABLE_SF === 'true') {
return this.salesforceService.createOrUpdateContactCandidateSalesforceLead(
contactCandidateFormDto
);
}
}

async sendCandidateInscriptionToSalesforce(
inscriptionCandidateFormDto: InscriptionCandidateFormDto
) {
return this.salesforceService.createOrUpdateInscriptionCandidateSalesforceLead(
inscriptionCandidateFormDto
);
if (process.env.ENABLE_SF === 'true') {
return this.salesforceService.createOrUpdateInscriptionCandidateSalesforceLead(
inscriptionCandidateFormDto
);
}
}

async sendContactUsMail(contactUsFormDto: ContactUsFormDto) {
return this.mailsService.sendContactUsMail(contactUsFormDto);
}

async getCampaignsFromSF() {
return this.salesforceService.getCampaigns();
if (process.env.ENABLE_SF === 'true') {
return this.salesforceService.getCampaigns();
}
}
}

0 comments on commit f1d40c5

Please sign in to comment.