N-FIN-79: fix sample data generation
This commit is contained in:
parent
53247d382d
commit
98f29a8366
1 changed files with 4 additions and 1 deletions
|
@ -136,6 +136,9 @@ export default async function generateSampleData(): Promise<ActionResponse> {
|
||||||
date.setDate(1);
|
date.setDate(1);
|
||||||
date.setMonth(date.getMonth() - i);
|
date.setMonth(date.getMonth() - i);
|
||||||
|
|
||||||
|
const categoryId =
|
||||||
|
categories.find((it) => it.name === 'Salary')?.id!;
|
||||||
|
|
||||||
await prisma.payment.create({
|
await prisma.payment.create({
|
||||||
data: {
|
data: {
|
||||||
userId: user.sub,
|
userId: user.sub,
|
||||||
|
@ -143,7 +146,7 @@ export default async function generateSampleData(): Promise<ActionResponse> {
|
||||||
date: date,
|
date: date,
|
||||||
payorId: entities[1].id,
|
payorId: entities[1].id,
|
||||||
payeeId: entities[0].id,
|
payeeId: entities[0].id,
|
||||||
categoryId: 5,
|
categoryId: categoryId,
|
||||||
createdAt: date,
|
createdAt: date,
|
||||||
updatedAt: date,
|
updatedAt: date,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue