call res just once

* closes #4
This commit is contained in:
Matthias Kretschmann 2018-06-25 16:45:26 +02:00
parent b6b73ede2b
commit e84e15a92c
Signed by: m
GPG Key ID: 606EEEF3C479A91F
1 changed files with 1 additions and 2 deletions

View File

@ -31,7 +31,6 @@ const sendRequest = (options, res) => {
// just pass through whatever we get from the APIs
// as the response
res.send(body)
res.sendStatus(response.statusCode)
})
}
@ -58,7 +57,7 @@ server.get('/crm/:data', (req, res) => {
const { data } = req.params
const options = {
url: `${apiUrlZohoCRM}Leads`, // eslint-disable-line max-len
url: `${apiUrlZohoCRM}Leads`,
headers: { 'Authorization': `Zoho-oauthtoken ${ZOHO_CRM_TOKEN}` },
method: 'POST',
formData: data