close to getting all nonprofits to render
This commit is contained in:
@@ -2,16 +2,18 @@ require('dotenv').load();
|
||||
var Bonfire = require('../models/Bonfire.js'),
|
||||
Courseware = require('../models/Courseware.js'),
|
||||
Wiki = require('../models/Wiki.js'),
|
||||
Nonprofit = require('../models/Nonprofit.js'),
|
||||
mongoose = require('mongoose'),
|
||||
secrets = require('../config/secrets'),
|
||||
coursewares = require('./coursewares.json'),
|
||||
wikis = require('./wikis.json')
|
||||
wikis = require('./wikis.json'),
|
||||
nonprofits = require('./nonprofits.json'),
|
||||
bonfires = require('./bonfires.json');
|
||||
|
||||
mongoose.connect(secrets.db);
|
||||
|
||||
var counter = 0;
|
||||
var offerings = 3;
|
||||
var offerings = 4;
|
||||
|
||||
var CompletionMonitor = function() {
|
||||
counter++;
|
||||
@@ -75,3 +77,20 @@ Wiki.remove({}, function(err, data) {
|
||||
});
|
||||
console.log('wikis');
|
||||
});
|
||||
|
||||
Nonprofit.remove({}, function(err, data) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
} else {
|
||||
console.log('Deleted ', data);
|
||||
}
|
||||
Nonprofit.create(nonprofits, function(err, data) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log('Saved ', data);
|
||||
}
|
||||
CompletionMonitor();
|
||||
});
|
||||
console.log('nonprofits');
|
||||
});
|
||||
|
Reference in New Issue
Block a user