From 2a4e1ff734533a026ebf4122c31355e2dffba1b2 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 12 Jun 2020 20:08:58 +0300 Subject: style: fix some eslint errors --- populateDb.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'populateDb.ts') diff --git a/populateDb.ts b/populateDb.ts index 8000111..156d4f2 100644 --- a/populateDb.ts +++ b/populateDb.ts @@ -37,7 +37,7 @@ const createPoll = (authorId: string): Promise => { return app.service('polls').create({ contents: { left: generateImageData(), - right: generateImageData(), + right: generateImageData() }, authorId }); @@ -57,7 +57,7 @@ const populate = async () => { for (let i = 0; i < POLLS_AMOUNT; i++) { const sampleUser = _.sample(users); await createPoll(sampleUser?._id); - }; + } }; populate().finally(mongoose.disconnect); -- cgit v1.2.3 From 7e4ebee9a0e56546d6dce76c5c48d6d13371c689 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 12 Jun 2020 20:20:33 +0300 Subject: style: fix all eslint errors --- populateDb.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'populateDb.ts') diff --git a/populateDb.ts b/populateDb.ts index 156d4f2..0a89cc9 100644 --- a/populateDb.ts +++ b/populateDb.ts @@ -54,10 +54,10 @@ const createUser = (name: string): Promise => { const populate = async () => { const users = await bluebird.map(names, name => createUser(name)); - for (let i = 0; i < POLLS_AMOUNT; i++) { + await bluebird.mapSeries(new Array(POLLS_AMOUNT), async () => { const sampleUser = _.sample(users); - await createPoll(sampleUser?._id); - } + return createPoll(sampleUser?._id); + }); }; populate().finally(mongoose.disconnect); -- cgit v1.2.3