diff --git a/.cursorignore b/.cursorignore new file mode 100644 index 0000000..13f3eee --- /dev/null +++ b/.cursorignore @@ -0,0 +1,7 @@ + # Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv) +node_modules/ +.git/ +.gitignore +.cursorignore +.cursorrules +.cursorconfig diff --git a/app/(dashboard)/actions.ts b/app/(dashboard)/actions.ts index 006d4a6..e54854b 100644 --- a/app/(dashboard)/actions.ts +++ b/app/(dashboard)/actions.ts @@ -379,7 +379,7 @@ export async function updateObituaryAction( surname: relative.surname || "", givenNames: relative.givenNames || "", relationship: relative.relationship || "", - familyRelationshipId: relative.familyRelationshipId || undefined, + familyRelationship: relative.familyRelationship || undefined, predeceased: relative.predeceased, obituaryId: id, }, @@ -414,6 +414,18 @@ export async function updateObituaryAction( ...updateData, // Ensure batchNumberId is properly handled batchNumberId: updateData.batchNumberId || null, + relatives: { + deleteMany: {}, // Delete all existing relatives + create: updateData.relatives?.map( + (relative: Prisma.RelativeCreateInput) => ({ + surname: relative.surname, + givenNames: relative.givenNames, + relationship: relative.relationship, + familyRelationship: relative.familyRelationship, + predeceased: relative.predeceased, + }) + ), + }, }, include: { relatives: true, diff --git a/app/(dashboard)/edit-obituary-dialog.tsx b/app/(dashboard)/edit-obituary-dialog.tsx index 570c234..fa4bc5e 100644 --- a/app/(dashboard)/edit-obituary-dialog.tsx +++ b/app/(dashboard)/edit-obituary-dialog.tsx @@ -1398,7 +1398,6 @@ export function EditObituaryDialog({ placeholder="Select a batch number" emptyText="No batch numbers found." items={batchNumbers.map((batch) => { - console.log("Processing batch:", batch); return { id: batch.id, name: `${batch.number} (${batch._count?.obituaries} of ${batch.assignedObituaries} done) Created by ${batch.createdBy?.fullName || "Unknown"} on ${batch.createdAt.toLocaleDateString()}`,