Save reminder count properly
Earlier, it wasn't being checked at all so everything was being set to the default of 10.
This commit is contained in:
parent
9530362baf
commit
3e0e775af9
1 changed files with 9 additions and 0 deletions
|
@ -144,6 +144,14 @@ router.post('/pledge', async (req, res) => {
|
|||
}
|
||||
|
||||
let phone = req.body.phone
|
||||
|
||||
let retryTimes
|
||||
try {
|
||||
retryTimes = req.body['reminder-count']
|
||||
} catch (err) {
|
||||
errors.push('Invalid retry count. Please choose a positive number!')
|
||||
}
|
||||
|
||||
let newsletter = req.body.newsletter == 'yes' ? true : false
|
||||
let overseas = req.body.overseas == 'yes' ? true : false
|
||||
let messages = req.body.messages
|
||||
|
@ -162,6 +170,7 @@ router.post('/pledge', async (req, res) => {
|
|||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue