diff --git a/server/index.js b/server/index.js index c7d7202..cd8bf43 100644 --- a/server/index.js +++ b/server/index.js @@ -123,8 +123,8 @@ function validatePledge(body, PledgeModel = Pledge) { // errors get saved here let errors = [] - let robo = body.robo - if(robo != 'no') { + let was_robot = body.was_robot + if(was_robot != 'no') { errors.push('Only humans are allowed to donate money. Robots are too digital 🙁') } @@ -155,29 +155,29 @@ function validatePledge(body, PledgeModel = Pledge) { let phone = body.phone - let retryTimes + let retry_times try { - retryTimes = body['reminder-count'] + retry_times = body.retry_times } catch (err) { errors.push('Invalid retry count. Please choose a positive number!') } - let newsletter = body.newsletter == 'yes' ? true : false + let get_newsletter = body.get_newsletter == 'yes' ? true : false let overseas = body.overseas == 'yes' ? true : false - let messages = body.messages + let other_message = body.other_message // enter the info let pledge = new PledgeModel() // may be Pledge or UnverifiedPledge - pledge.set('was_robot', robo) + pledge.set('was_robot', was_robot) pledge.set('amount', amount) pledge.set('overseas', overseas) pledge.set('name', name) pledge.set('anonymous', anonymous) pledge.set('email', email) pledge.set('phone', phone) - pledge.set('retry_times', retryTimes) - pledge.set('get_newsletter', newsletter) - pledge.set('other_message', messages) + pledge.set('retry_times', retry_times) + pledge.set('get_newsletter', get_newsletter) + pledge.set('other_message', other_message) // return it all! return { diff --git a/src/index.htm b/src/index.htm index 6e6e32a..036eeae 100644 --- a/src/index.htm +++ b/src/index.htm @@ -252,36 +252,36 @@
- +

Would you like to receive our weekly newsletter?

- +
- +
- +

Are you a robot?

- +
- +