- Sending Newsletter, others settings.

This commit is contained in:
Paolo Arena
2019-12-04 18:20:50 +01:00
parent d2dc16b7fb
commit b92655c2e5
5 changed files with 33 additions and 15 deletions

View File

@@ -49,7 +49,7 @@ SettingsSchema.statics.executeQueryTable = function (idapp, params) {
return tools.executeQueryTable(this, idapp, params);
};
SettingsSchema.statics.getValDbSettings = function (idapp, key) {
SettingsSchema.statics.getValDbSettings = function (idapp, key, def) {
return Settings.findOne({ idapp, key })
.then((myrec) => {
// console.log('getValDbSettings', myrec, 'idapp', idapp);
@@ -63,12 +63,12 @@ SettingsSchema.statics.getValDbSettings = function (idapp, key) {
else
return myrec.value_str;
} else {
return ''
return def
}
}).catch((err) => {
console.error('getValDbSettings', err);
return null;
return def;
});
};