adapt chat routes to groups saved on user model

This commit is contained in:
Matteo Pagliazzi
2015-12-18 16:29:57 +01:00
parent ddf77e0e35
commit e53bd5079a
4 changed files with 17 additions and 11 deletions
+2 -2
View File
@@ -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) {
+1 -1
View File
@@ -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