issue #596 solved

parent 0487e31d
Showing with 25 additions and 2 deletions
......@@ -486,8 +486,31 @@ module.exports = {
if (!populated_ws || !populated_ws.tries || populated_ws.tries.length == 0)
return next_ws();
l_ws.push(populated_ws);
return next_ws();
// Recorremos tries
var l_tries = [];
async.each(populated_ws.tries,
function(t, next_t) {
Try.findOne(t.id)
.populate('actions')
.then((populated_try) => {
if (!populated_try || !populated_try.actions || populated_try.actions.length == 0)
return next_t();
l_tries.push(populated_try);
next_t();
})
.catch((err) => {throw err});
},
function(err) { // Ya tenemos todos los tries poblados con acciones
if (err) throw err;
if (l_tries.length > 0) {
populated_ws.tries = l_tries;
l_ws.push(populated_ws);
}
return next_ws();
});
})
.catch((err) => {throw err});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment