Did more work to beer post page, seed

Worked on comments and beer recs features. Fine tuning database seed amounts.
This commit is contained in:
Aaron William Po
2023-01-29 21:53:05 -05:00
parent fe277d5964
commit 0b96c8f1f5
38 changed files with 833 additions and 221 deletions

View File

@@ -23,12 +23,15 @@ const createNewBeerComments = async ({
const content = faker.lorem.lines(5);
const user = users[Math.floor(Math.random() * users.length)];
const beerPost = beerPosts[Math.floor(Math.random() * beerPosts.length)];
const createdAt = faker.date.past(1);
beerCommentPromises.push(
prisma.beerComment.create({
data: {
content,
postedBy: { connect: { id: user.id } },
beerPost: { connect: { id: beerPost.id } },
rating: Math.floor(Math.random() * 5) + 1,
createdAt,
},
}),
);