Skip to content

Commit

Permalink
fix: foreach creates problems with async/await, so replaced with sequ…
Browse files Browse the repository at this point in the history
…ential for()
  • Loading branch information
quantum-grit committed Oct 29, 2023
1 parent 45e8cd3 commit 3959390
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/seed/donationWish/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function donationsWishesSeed() {
throw new Error('There are no donations created yet!')
}

donations.forEach(async (donation) => {
for (const donation of donations) {
const person = await prisma.person.findFirst()
if (!person) {
throw new Error('There are no people created yet!')
Expand All @@ -41,5 +41,5 @@ export async function donationsWishesSeed() {
await prisma.donationWish.create({
data: donationWishData,
})
})
}
}

0 comments on commit 3959390

Please sign in to comment.