Merge pull request #14 from coralproject/lint-error

Linting Error
This commit is contained in:
Wyatt Johnson
2016-11-04 13:53:54 -06:00
committed by GitHub
+9 -4
View File
@@ -1,7 +1,12 @@
const mongoose = require('../mongoose');
const Setting = require('../models/setting');
const defaults = {id: '1', moderation: 'pre'};
Setting.update({id: '1'}, {$setOnInsert: defaults}, {upsert: true}).then(() => {
console.log('created settings object.');
process.exit();
}).catch(console.error);
Setting.update({id: '1'}, {$setOnInsert: defaults}, {upsert: true})
.then(() => {
console.log('Created settings object.');
mongoose.disconnect();
}).catch((err) => {
console.error(`failed to create the settings object ${JSON.stringify(err)}`);
throw new Error(err); // just to be safe
});