Skip to content

Commit 3dd5bbb

Browse files
authored
Merge pull request #18 from justinr1234/fix-post-seed-bug
Fix seeding bug
2 parents 1f5529a + f897c6d commit 3dd5bbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/example-forum/lib/server/seed/seed_posts.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ if (getSetting('forum.seedOnStart')) {
6161

6262
const createComment = async (slug, username, body, parentBody) => {
6363
const user = await Users.rawCollection().findOne({ username: username });
64+
const post = await Posts.rawCollection().findOne({ dummySlug: slug });
6465
const comment = {
65-
postId: await Posts.rawCollection().findOne({ dummySlug: slug })._id,
66+
postId: post._id,
6667
userId: user._id,
6768
body: body,
6869
isDummy: true,

0 commit comments

Comments
 (0)