refactor(first_name): check if first_name is sent as empty string (#4832)

This commit is contained in:
Narayan Bhat
2024-05-31 16:38:52 +05:30
committed by GitHub
parent 48dac12ced
commit 5cb84f66e4

View File

@ -2904,7 +2904,11 @@ impl AddressDetails {
pub fn unify_address_details(self, other: Option<&Self>) -> Self {
if let Some(other) = other {
let (first_name, last_name) = if self.first_name.is_some() {
let (first_name, last_name) = if self
.first_name
.as_ref()
.is_some_and(|first_name| !first_name.is_empty_after_trim())
{
(self.first_name, self.last_name)
} else {
(other.first_name.clone(), other.last_name.clone())