From faa7d45674f3886e8ee8ddd64f7250ae6d0c83f7 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 5 Jul 2020 12:23:24 +0300 Subject: feat: update populate script --- populateDb.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/populateDb.ts b/populateDb.ts index e25005d..de7ead9 100644 --- a/populateDb.ts +++ b/populateDb.ts @@ -57,8 +57,7 @@ const createPoll = (authorId: string): Promise => { left: generateImageData(), right: generateImageData() }, - authorId - }); + }, { user: { _id: authorId }, authenticated: true }); }; const createUser = (username: string): Promise => { @@ -69,18 +68,18 @@ const createUser = (username: string): Promise => { }); }; -const createVote = (userId: string, pollId: string): Promise => { +const createVote = (authorId: string, pollId: string): Promise => { return app.service('votes').create({ pollId, which: _.sample(choices) - }, { user: { _id: userId }, authenticated: true }); + }, { user: { _id: authorId }, authenticated: true }); }; const createFeedback = (userId: string): Promise => { return app.service('feedback').create({ version: 'v1.0.0', score: _.sample([1, 2, 3, 4, 5]), - content: 'Absolutely amazing!' + contents: 'Absolutely amazing!' }, { user: { _id: userId }, authenticated: true }); }; -- cgit v1.2.3