add socket.io back, cleanup
Change-Id: I74e043268c23fb45371f1e397ca2931ca177afc3
diff --git a/model/Account.js b/model/Account.js
index 669381e..c2883d2 100644
--- a/model/Account.js
+++ b/model/Account.js
@@ -23,11 +23,12 @@
this.volatileDetails = data.volatileDetails
}
- getObject() {
+ async getObject() {
+ const hasModerators = this.defaultModerators && this.defaultModerators.length
return {
id: this.id,
details: this.details,
- defaultModerators: this.defaultModerators ? this.defaultModerators.map(c => c.getObject()) : undefined,
+ defaultModerators: hasModerators ? await Promise.all(this.defaultModerators.map(async c => await c.getObject())) : undefined,
volatileDetails: this.volatileDetails
}
}