* Added bannedWordsAllowed attribute to Group attributes Added an optional Boolean attribute which will determine if banned words are allowed * Added bannedWordsAllowed attribute to non-settable fields
This commit is contained in:
@@ -85,6 +85,7 @@ export const schema = new Schema({
|
||||
$type: String, enum: ['private', 'public'], default: 'private', required: true,
|
||||
},
|
||||
chat: Array, // Used for backward compatibility, but messages aren't stored here
|
||||
bannedWordsAllowed: { $type: Boolean, required: false },
|
||||
leaderOnly: { // restrict group actions to leader (members can't do them)
|
||||
challenges: { $type: Boolean, default: false, required: true },
|
||||
// invites: {$type: Boolean, default: false, required: true},
|
||||
@@ -150,7 +151,7 @@ export const schema = new Schema({
|
||||
});
|
||||
|
||||
schema.plugin(baseModel, {
|
||||
noSet: ['_id', 'balance', 'quest', 'memberCount', 'chat', 'challengeCount', 'tasksOrder', 'purchased', 'managers'],
|
||||
noSet: ['_id', 'balance', 'quest', 'memberCount', 'chat', 'bannedWordsAllowed', 'challengeCount', 'tasksOrder', 'purchased', 'managers'],
|
||||
private: ['purchased.plan'],
|
||||
toJSONTransform (plainObj, originalDoc) {
|
||||
if (plainObj.purchased) plainObj.purchased.active = originalDoc.hasActiveGroupPlan();
|
||||
|
||||
Reference in New Issue
Block a user