fix(tools): setup seed

This commit is contained in:
nikrb
2018-11-16 21:23:02 +00:00
committed by Kristofer Koishigawa
parent cee98aef43
commit 22ed2b964a

View File

@ -37,12 +37,12 @@ MongoClient.connect(
const db = client.db('freecodecamp');
const challengeCollection = db.collection('challenge');
challengeCollection.deleteMany({}, err => {
challengeCollection.deleteMany({}, async err => {
handleError(err, client);
log('deleted all the challenges');
const curriculum = getChallengesForLang(lang);
const curriculum = await getChallengesForLang(lang);
const allChallenges = Object.keys(curriculum)
.map(key => curriculum[key].blocks)