Moved chained funcitons to multiple lines

This commit is contained in:
David Erwin
2016-11-10 14:52:05 -05:00
parent 26f48196d9
commit d9dc198d46
11 changed files with 131 additions and 69 deletions
+4 -2
View File
@@ -24,11 +24,13 @@ program
const Setting = require('../models/setting');
const defaults = {id: '1', moderation: 'pre'};
Setting.update({id: '1'}, {$setOnInsert: defaults}, {upsert: true})
Setting
.update({id: '1'}, {$setOnInsert: defaults}, {upsert: true})
.then(() => {
console.log('Created settings object.');
mongoose.disconnect();
}).catch((err) => {
})
.catch((err) => {
console.error(`failed to create the settings object ${JSON.stringify(err)}`);
throw new Error(err); // just to be safe
});