Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change to INSERT a new record if not found by the UPDATE #1

Merged
merged 3 commits into from Sep 11, 2015

Conversation

jeffdonthemic
Copy link
Contributor

I trimmed the strings and made the change so that if the update returns 0 records then it inserts whatever they entered in the form. Hopefully this is the info we are checking for and they just didn't have the record in their org.

if (err != null || result.rowCount == 0) {
res.status(400).json({error: 'The specified contact was not found.'});
conn.query('INSERT INTO salesforce.Contact (Phone, FirstName, LastName, Email) VALUES ($1, $2, $3, $4)',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also need to set MobilePhone since that is our little hidden field that we use to verify the user didn't cheat by updating the Phone in Salesforce.

jamesward added a commit that referenced this pull request Sep 11, 2015
change to INSERT a new record if not found by the UPDATE
@jamesward jamesward merged commit ef89aa9 into jamesward:master Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants