mirror of
https://github.com/oceanprotocol/webtasks
synced 2025-01-08 21:04:03 +01:00
Merge pull request #24 from oceanprotocol/fix/error-response
don't parse second response body
This commit is contained in:
commit
476ddcfb56
@ -91,14 +91,12 @@ server.post('/newsletter/:email', (req, res) => {
|
|||||||
request.put(optionsCreate, (error2, response, body2) => {
|
request.put(optionsCreate, (error2, response, body2) => {
|
||||||
if (error2) res.send(error2)
|
if (error2) res.send(error2)
|
||||||
|
|
||||||
const data2 = JSON.parse(body2)
|
if (Number.isInteger(body2.status)) {
|
||||||
|
|
||||||
if (Number.isInteger(data2.status)) {
|
|
||||||
res.send(body2)
|
res.send(body2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch in native GDPR permissions
|
// Patch in native GDPR permissions
|
||||||
addMarketingPermissions(data2, () => {
|
addMarketingPermissions(body2, () => {
|
||||||
res.send('{ "status": "created" }')
|
res.send('{ "status": "created" }')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user