merge master

This commit is contained in:
riley
2016-11-16 11:58:01 -07:00
26 changed files with 316 additions and 173 deletions
+10 -1
View File
@@ -11,7 +11,8 @@ const Schema = mongoose.Schema;
const SettingSchema = new Schema({
id: {type: String, default: '1'},
moderation: {type: String, enum: ['pre', 'post'], default: 'pre'},
smtp_connection_string: {type: String, default: ''},
infoBoxEnable: {type: Boolean, default: false},
infoBoxContent: {type: String, default: ''}
}, {
timestamps: {
createdAt: 'created_at',
@@ -43,6 +44,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