aboutsummaryrefslogtreecommitdiff
path: root/populateDb.ts
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-06-25 18:56:55 +0300
committerGitHub <noreply@github.com>2020-06-25 18:56:55 +0300
commit343a975413d8d3ce8194507017fb4ca01a4faf54 (patch)
treebdf1ebf9113739bfb08cd61239c117d02e273fe7 /populateDb.ts
parent32e9cd6eec8f45fd9b53c8ab3af5907c8d4064bc (diff)
parent7bf3e5020bf456b1450bb19bea43df7862cfb08e (diff)
downloadwhich-api-343a975413d8d3ce8194507017fb4ca01a4faf54.tar.gz
Merge pull request #10 from which-ecosystem/circleci
Configure CI
Diffstat (limited to 'populateDb.ts')
-rw-r--r--populateDb.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/populateDb.ts b/populateDb.ts
index 757280a..6daa2f8 100644
--- a/populateDb.ts
+++ b/populateDb.ts
@@ -36,7 +36,7 @@ const choices = [
const createPoll = (authorId: string): Promise<Poll> => {
const generateImageData = () => ({
- url: _.sample(imageUrls) || '',
+ url: _.sample(imageUrls) || ''
});
return app.service('polls').create({
@@ -61,7 +61,7 @@ const createVote = (userId: string, pollId: string): Promise<Vote> => {
pollId,
which: _.sample(choices)
}, { user: { _id: userId } });
-}
+};
const populate = async () => {
@@ -72,7 +72,7 @@ const populate = async () => {
return createPoll(user?._id || '');
});
- const votes = await bluebird.map(users, user => {
+ await bluebird.map(users, user => {
const pollsToVote = _.sampleSize(polls, _.random(0, POLLS_AMOUNT));
return bluebird.map(pollsToVote, poll => createVote(user?._id || '', poll?._id || ''));
});