Mother and father can not be identical
This commit is contained in:
		@@ -82,6 +82,8 @@ enum MemberControllerErr {
 | 
			
		||||
    MotherNotExisting,
 | 
			
		||||
    #[error("Father does not exists!")]
 | 
			
		||||
    FatherNotExisting,
 | 
			
		||||
    #[error("Mother and father can not be identical!")]
 | 
			
		||||
    MotherAndFatherIdentical,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn check_opt_str_val(
 | 
			
		||||
@@ -188,6 +190,10 @@ impl MemberRequest {
 | 
			
		||||
            if !members_service::exists(member.family_id(), mother).await? {
 | 
			
		||||
                return Err(MemberControllerErr::MotherNotExisting.into());
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if self.mother == self.father {
 | 
			
		||||
                return Err(MemberControllerErr::MotherAndFatherIdentical.into());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if let Some(father) = self.father {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user