Ability to post in Forum
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
export default class OrderedObject {
|
||||
entries = []
|
||||
ids = {}
|
||||
indexes = []
|
||||
|
||||
add(id, data) {
|
||||
if(this.get(id)) {
|
||||
if(this.ids[id]) {
|
||||
console.error(`Can't add item ${id}: id already exists`)
|
||||
throw new global.ServerError(400, `Member with this email already exists`)
|
||||
}
|
||||
@@ -23,12 +24,4 @@ export default class OrderedObject {
|
||||
return this.entries[this.ids[key]]
|
||||
}
|
||||
}
|
||||
|
||||
get(key) {
|
||||
if (typeof key === "number") {
|
||||
return this.entries[key]
|
||||
} else {
|
||||
return this.entries[this.ids[key]]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user