working demo
This commit is contained in:
parent
b194d2031d
commit
a8de581c09
6 changed files with 216 additions and 27 deletions
|
|
@ -97,6 +97,9 @@ router.get('/parent/:parent_upn', async function (req, res) {
|
|||
allowedAttributes.forEach(function (attribute) {
|
||||
parent[attribute] = req.user[attribute];
|
||||
});
|
||||
// Get the list of students linked to the parent
|
||||
let students = await directory.getStudentsByParent(parent.username);
|
||||
parent.students = students;
|
||||
res.json(parent);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ router.get('/student/:upn', function (req, res) {
|
|||
allowedAttributes.forEach(function (attribute) {
|
||||
student[attribute] = req.user[attribute];
|
||||
});
|
||||
// Return the student's linked parent in the response in JSON format
|
||||
student['primary_parent'] = req.user['primaryParent'];
|
||||
res.json(student);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue