Skip to content

Commit

Permalink
Correctly seed notes half the time
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinemeremChigbo committed Nov 25, 2024
1 parent 8596574 commit 83b626f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions prisma/seed/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,17 @@ const main = async () => {
);

await seed.absence((createMany) =>
createMany(10, () => ({
lessonDate: faker.date.future(),
lessonPlan: faker.internet.url(),
reasonOfAbsence: faker.lorem.sentence(),
notes: faker.helpers.maybe(() => faker.lorem.paragraph(), {
createMany(10, () => {
const maybeNotes = faker.helpers.maybe(() => faker.lorem.paragraph(), {
probability: 0.5,
}),
}))
});
return {
lessonDate: faker.date.future(),
lessonPlan: faker.internet.url(),
reasonOfAbsence: faker.lorem.sentence(),
notes: maybeNotes ?? null,
};
})
);

await seed.mailingList((createMany) =>
Expand Down

0 comments on commit 83b626f

Please sign in to comment.