Test force json parse MoreInfo - Fase 2

pull/1/head
Jéluchu 5 years ago
parent e59e7e4806
commit 62121cbc53

@ -171,12 +171,11 @@ router.get('/moreInfo/:title' , (req, res) =>{
let title = req.params.title;
api.getMoreInfo(title)
.then(data =>{
if (data.length > 0) {
let info = JSON.parse(JSON.stringify(data))
res.status(200).json({
info
});
.then(info =>{
if (info.length > 0) {
res.status(200).json(
JSON.parse(JSON.stringify(info[0]))
);
} else { res.status(400) }
}).catch((err) =>{
console.error(err);

Loading…
Cancel
Save