Add new field

This commit is contained in:
2023-08-08 11:11:29 +02:00
parent 0262889913
commit eacf3b0700
5 changed files with 7 additions and 0 deletions

View File

@ -45,6 +45,8 @@ pub struct MemberRequest {
father: Option<MemberID>,
#[serde(flatten, with = "prefix_birth")]
birth: Option<RequestDate>,
#[serde(default)]
dead: bool,
#[serde(flatten, with = "prefix_death")]
death: Option<RequestDate>,
note: Option<String>,
@ -221,6 +223,7 @@ impl MemberRequest {
member.birth_month = self.birth.as_ref().map(|m| m.month).unwrap_or_default();
member.birth_day = self.birth.as_ref().map(|m| m.day).unwrap_or_default();
member.dead = self.dead;
member.death_year = self.death.as_ref().map(|m| m.year).unwrap_or_default();
member.death_month = self.death.as_ref().map(|m| m.month).unwrap_or_default();
member.death_day = self.death.as_ref().map(|m| m.day).unwrap_or_default();