getting org members

This commit is contained in:
metacryst
2026-01-13 14:27:44 -06:00
parent 134a6b8471
commit 237bbfedd4
7 changed files with 59 additions and 37 deletions

View File

@@ -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]
}
}