don't parse second response

This commit is contained in:
Matthias Kretschmann 2018-12-11 12:33:33 +01:00
parent 8513c48115
commit b4c7e4d4b7
Signed by: m
GPG Key ID: 606EEEF3C479A91F
1 changed files with 2 additions and 4 deletions

View File

@ -91,14 +91,12 @@ server.post('/newsletter/:email', (req, res) => {
request.put(optionsCreate, (error2, response, body2) => {
if (error2) res.send(error2)
const data2 = JSON.parse(body2)
if (Number.isInteger(data2.status)) {
if (Number.isInteger(body2.status)) {
res.send(body2)
}
// Patch in native GDPR permissions
addMarketingPermissions(data2, () => {
addMarketingPermissions(body2, () => {
res.send('{ "status": "created" }')
})
})