From 06b2d967dbb60833069ab67b8f04b425ab28da14 Mon Sep 17 00:00:00 2001 From: Jonas Hagberg Date: Thu, 19 Oct 2023 12:09:34 +0200 Subject: [PATCH 1/2] fix: newBirth do not return the actual date use dat from the post data instead --- frontend/src/individual_breeding_form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/individual_breeding_form.tsx b/frontend/src/individual_breeding_form.tsx index 303b52bf..1ab14062 100644 --- a/frontend/src/individual_breeding_form.tsx +++ b/frontend/src/individual_breeding_form.tsx @@ -381,7 +381,7 @@ export function IndividualBreedingForm({ "breeding", newBreeding.breeding_id, "birth_date", - newBirth.birth_date + newBirthData.date ); closeDialog(); } From ebcb33c74aae65fa1b65bb0c12ef56552869c00d Mon Sep 17 00:00:00 2001 From: Jonas Hagberg Date: Thu, 19 Oct 2023 12:10:06 +0200 Subject: [PATCH 2/2] fix: Do not update number if birthdate is undefined --- frontend/src/individual_edit.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/individual_edit.tsx b/frontend/src/individual_edit.tsx index f0baf962..014864c3 100644 --- a/frontend/src/individual_edit.tsx +++ b/frontend/src/individual_edit.tsx @@ -214,6 +214,7 @@ export function IndividualEdit({ id }: { id: string | undefined }) { ) { handleUpdateIndividual("birth_date", formatDate(individual?.birth_date)); } else if ( + individual?.birth_date && individual?.birth_date?.split("-")[0].slice(-2) != oldIndividual?.birth_date?.split("-")[0].slice(-2) ) {