Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5e8dadf3
authored
Oct 24, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
issue #596 solved
parent
0487e31d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
sails/src/api/models/Student.js
sails/src/api/models/Student.js
View file @
5e8dadf3
...
...
@@ -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
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment