Skip to content

Commit

Permalink
refactor(first_name): check if first_name is sent as empty string (#4832
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Narayanbhat166 authored May 31, 2024
1 parent 48dac12 commit 5cb84f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 5cb84f6

Please sign in to comment.