This commit is contained in:
@@ -48,23 +48,20 @@ impl CoupleRequest {
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(husband) = self.husband {
|
||||
if !members_service::exists(couple.family_id(), husband).await? {
|
||||
if let Some(husband) = self.husband
|
||||
&& !members_service::exists(couple.family_id(), husband).await? {
|
||||
return Err(CoupleControllerErr::HusbandNotExisting.into());
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(d) = &self.wedding {
|
||||
if !d.check() {
|
||||
if let Some(d) = &self.wedding
|
||||
&& !d.check() {
|
||||
return Err(CoupleControllerErr::MalformedDateOfWedding.into());
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(d) = &self.divorce {
|
||||
if !d.check() {
|
||||
if let Some(d) = &self.divorce
|
||||
&& !d.check() {
|
||||
return Err(CoupleControllerErr::MalformedDateOfDivorce.into());
|
||||
}
|
||||
}
|
||||
|
||||
couple.set_wife(self.wife);
|
||||
couple.set_husband(self.husband);
|
||||
|
Reference in New Issue
Block a user