From 98f29a8366ba0bcd3645398604aece490fd192b9 Mon Sep 17 00:00:00 2001 From: Markus Thielker Date: Wed, 4 Dec 2024 14:58:06 +0100 Subject: [PATCH] N-FIN-79: fix sample data generation --- src/lib/actions/generateSampleData.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/actions/generateSampleData.ts b/src/lib/actions/generateSampleData.ts index 8b16d17..37cc53d 100644 --- a/src/lib/actions/generateSampleData.ts +++ b/src/lib/actions/generateSampleData.ts @@ -136,6 +136,9 @@ export default async function generateSampleData(): Promise { date.setDate(1); date.setMonth(date.getMonth() - i); + const categoryId = + categories.find((it) => it.name === 'Salary')?.id!; + await prisma.payment.create({ data: { userId: user.sub, @@ -143,7 +146,7 @@ export default async function generateSampleData(): Promise { date: date, payorId: entities[1].id, payeeId: entities[0].id, - categoryId: 5, + categoryId: categoryId, createdAt: date, updatedAt: date, },