getting org members
This commit is contained in:
@@ -39,8 +39,20 @@ export default class Member {
|
||||
}
|
||||
}
|
||||
|
||||
get(id) {
|
||||
return this.entries[this.ids[id]]
|
||||
getByNetwork(id) {
|
||||
let connections = db.MEMBER_IN_NETWORK.getByNetwork(id)
|
||||
let members = []
|
||||
connections.forEach((conn) => {
|
||||
members.push(this.getByID(conn.from))
|
||||
})
|
||||
return members
|
||||
}
|
||||
|
||||
getByID(id) {
|
||||
if(typeof id === 'string') {
|
||||
id = id.split("-")[1]
|
||||
}
|
||||
return global.db.nodes[this.indices[0] + id - 1]
|
||||
}
|
||||
|
||||
getByEmail(email) {
|
||||
@@ -51,15 +63,4 @@ export default class Member {
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
getIDFromEmail(email) {
|
||||
let index = 0
|
||||
for(let i=0; i<this.entries.length; i++) {
|
||||
if(this.entries[i].email === email) {
|
||||
index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
return Object.entries(this.ids)[index][0]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user