adapt chat routes to groups saved on user model
This commit is contained in:
@@ -127,7 +127,7 @@ schema.post('remove', function postRemoveGroup (group) {
|
||||
firebase.deleteGroup(group._id);
|
||||
});
|
||||
|
||||
schema.methods.toJSON = function groupToJSON () {
|
||||
/*schema.methods.toJSON = function groupToJSON () {
|
||||
let doc = this.toObject();
|
||||
// removeDuplicates(doc);
|
||||
doc._isMember = this._isMember; // TODO ?
|
||||
@@ -143,7 +143,7 @@ schema.methods.toJSON = function groupToJSON () {
|
||||
this.challengeCount = _.size(this.challenges);
|
||||
|
||||
return doc;
|
||||
};
|
||||
};*/
|
||||
|
||||
// TODO move to its own model
|
||||
export function chatDefaults (msg, user) {
|
||||
|
||||
@@ -479,7 +479,7 @@ schema.plugin(baseModel, {
|
||||
// TODO revisit a lot of things are missing
|
||||
noSet: ['_id', 'apiToken', 'auth.blocked', 'auth.timestamps', 'lastCron', 'auth.local.hashed_password', 'auth.local.salt', 'tasksOrder', 'tags', 'stats', 'challenges', 'guilds', 'party._id', 'party.quest', 'invitations'],
|
||||
private: ['auth.local.hashed_password', 'auth.local.salt'],
|
||||
toJSONTransform: function toJSON (doc) {
|
||||
toJSONTransform: function userToJSON (doc) {
|
||||
// FIXME? Is this a reference to `doc.filters` or just disabled code? Remove?
|
||||
doc.filters = {};
|
||||
doc._tmp = this._tmp; // be sure to send down drop notifs
|
||||
|
||||
Reference in New Issue
Block a user