chore: server code formatting
This commit is contained in:
parent
aedabcbdee
commit
68517170e2
234 changed files with 9824 additions and 6195 deletions
|
|
@ -3,10 +3,10 @@ const { SMS } = require('@vonage/sms')
|
|||
|
||||
const NAME = 'Vonage'
|
||||
|
||||
function sendMessage (account, rec) {
|
||||
function sendMessage(account, rec) {
|
||||
const credentials = new Auth({
|
||||
apiKey: account.apiKey,
|
||||
apiSecret: account.apiSecret
|
||||
apiSecret: account.apiSecret,
|
||||
})
|
||||
|
||||
const from = account.fromNumber
|
||||
|
|
@ -14,10 +14,9 @@ function sendMessage (account, rec) {
|
|||
const to = rec.sms.toNumber || account.toNumber
|
||||
|
||||
const smsClient = new SMS(credentials)
|
||||
smsClient.send({ from, text, to })
|
||||
.catch(err => {
|
||||
throw new Error(`Vonage error: ${err.message}`)
|
||||
})
|
||||
smsClient.send({ from, text, to }).catch(err => {
|
||||
throw new Error(`Vonage error: ${err.message}`)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue