Merge branch 'master' into user-documentation

This commit is contained in:
Wyatt Johnson
2016-11-16 12:01:14 -07:00
committed by GitHub
25 changed files with 325 additions and 152 deletions
+11 -1
View File
@@ -3,7 +3,9 @@ const Schema = mongoose.Schema;
const SettingSchema = new Schema({
id: {type: String, default: '1'},
moderation: {type: String, enum: ['pre', 'post'], default: 'pre'}
moderation: {type: String, enum: ['pre', 'post'], default: 'pre'},
infoBoxEnable: {type: Boolean, default: false},
infoBoxContent: {type: String, default: ''}
}, {
timestamps: {
createdAt: 'created_at',
@@ -35,6 +37,14 @@ SettingSchema.statics.getModerationSetting = function () {
return this.findOne({id: '1'}).select('moderation');
};
/**
* Gets the info box settings and sends it back
* @return {Promise} content the content of the info Box
*/
SettingSchema.statics.getInfoBoxSetting = function () {
return this.findOne({id: '1'}).select('infoBoxEnable', 'infoBoxContent');
};
/**
* This will update the settings object with whatever you pass in
* @param {object} setting a hash of whatever settings you want to update