This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Description
.then(
(post) => {
comments.disableByParent(req.token, post)
})
.then(
(data) => res.send(data),
(error) => {
console.error(error)
res.status(500).send({
error: 'There was an error.'
})
}
)
should be
.then(
(post) => {
comments.disableByParent(req.token, post)
res.send(post)
},
(error) => {
console.error(error)
res.status(500).send({
error: 'There was an error.'
})
})
other wise console.log(data) before (data) => res.send(data) will get undefined, and if you try .then(res => res.json()) after fetch() in your api.js, you will get SyntaxError: Unexpected end of JSON input.