From 3959390a7678e4cf0fb22e19115b3ee8190d286c Mon Sep 17 00:00:00 2001 From: quantum-grit Date: Sun, 29 Oct 2023 21:31:18 +0200 Subject: [PATCH] fix: foreach creates problems with async/await, so replaced with sequential for() --- db/seed/donationWish/seed.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/seed/donationWish/seed.ts b/db/seed/donationWish/seed.ts index b70ff273a..491f99cd6 100644 --- a/db/seed/donationWish/seed.ts +++ b/db/seed/donationWish/seed.ts @@ -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!') @@ -41,5 +41,5 @@ export async function donationsWishesSeed() { await prisma.donationWish.create({ data: donationWishData, }) - }) + } }