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
cc78ffcf
authored
Aug 11, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixing issue with therapist related students
parent
a8f28e51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
sails/src/api/models/Student.js
sails/src/api/models/Student.js
View file @
cc78ffcf
...
...
@@ -305,8 +305,15 @@ module.exports = {
})
.
spread
((
stuSups
,
supOffs
)
=>
{
if
(
!
supOffs
||
supOffs
.
length
==
0
)
throw
new
Error
(
"No supervisors"
);
if
(
!
supOffs
||
supOffs
.
length
==
0
)
{
// if we get here, only the requester being directly related to the
// student is valid
var
supIdx
=
stuSups
.
findIndex
(
x
=>
x
.
supervisor
.
id
==
id_sup
);
if
(
supIdx
>=
0
)
return
callback
(
null
,
[
stuSups
[
supIdx
].
supervisor
]);
throw
new
Error
(
"No supervisors related"
);
}
// filter null entries and map them to the supervisor object
var
ss
=
_
.
compact
(
_
.
compact
(
stuSups
).
map
(
x
=>
x
.
supervisor
));
...
...
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