mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 18:39:32 +00:00
Added Class.getParents
This commit is contained in:
11
lib/Class.js
11
lib/Class.js
@@ -162,6 +162,17 @@ class Class {
|
|||||||
return { ids: ids, objs: students };
|
return { ids: ids, objs: students };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getParents() {
|
||||||
|
const parentInters = await Promise.all(this.students.map(s =>
|
||||||
|
s.getParents()));
|
||||||
|
|
||||||
|
const parents = [];
|
||||||
|
|
||||||
|
parentInters.forEach(pi => parents.push(...pi));
|
||||||
|
|
||||||
|
return parents;
|
||||||
|
}
|
||||||
|
|
||||||
getUsers(ids, type) {
|
getUsers(ids, type) {
|
||||||
const types = {
|
const types = {
|
||||||
account: 'Account',
|
account: 'Account',
|
||||||
|
|||||||
Reference in New Issue
Block a user