Archived
pusho
This commit is contained in:
+12
-8
@@ -80,16 +80,20 @@ low(new FileAsync(__dirname + '/db.json')) // production
|
||||
});
|
||||
const videos = db.get('videos');
|
||||
if (req.query.prevId) {
|
||||
let tmp = videos.map(el => el.id.reason.map(el =>
|
||||
el.reason.map(el2 => {
|
||||
if (el2.prevId === req.query.prevId) {
|
||||
return ({ ...el2, 'id': this.id })
|
||||
let tmp = [];
|
||||
for (let i = 0; i < videos.lenght; i++) {
|
||||
for (let j = 0; i < videos[i].reason.lenght; j++) {
|
||||
if (videos[i].reason[j].prevId === req.query.prevId) {
|
||||
let tmp2 = {
|
||||
...videos[i].reason[j],
|
||||
'id': videos[i].id
|
||||
}
|
||||
tmp.push(tmp2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}, el)));
|
||||
res.send(tmp)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
res.send(videos)
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user