Skip to content

Commit faa7d45

Browse files
committed
feat: update populate script
1 parent f38a1cf commit faa7d45

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

populateDb.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ const createPoll = (authorId: string): Promise<Poll> => {
5757
left: generateImageData(),
5858
right: generateImageData()
5959
},
60-
authorId
61-
});
60+
}, { user: { _id: authorId }, authenticated: true });
6261
};
6362

6463
const createUser = (username: string): Promise<User> => {
@@ -69,18 +68,18 @@ const createUser = (username: string): Promise<User> => {
6968
});
7069
};
7170

72-
const createVote = (userId: string, pollId: string): Promise<Vote> => {
71+
const createVote = (authorId: string, pollId: string): Promise<Vote> => {
7372
return app.service('votes').create({
7473
pollId,
7574
which: _.sample(choices)
76-
}, { user: { _id: userId }, authenticated: true });
75+
}, { user: { _id: authorId }, authenticated: true });
7776
};
7877

7978
const createFeedback = (userId: string): Promise<Feedback> => {
8079
return app.service('feedback').create({
8180
version: 'v1.0.0',
8281
score: _.sample([1, 2, 3, 4, 5]),
83-
content: 'Absolutely amazing!'
82+
contents: 'Absolutely amazing!'
8483
}, { user: { _id: userId }, authenticated: true });
8584
};
8685

0 commit comments

Comments
 (0)