Skip to content

Commit

Permalink
fix: show address
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and kris-liu-smile committed Jun 27, 2023
1 parent 7d1e637 commit af91707
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion apps/storefront/src/pages/address/components/AddressForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,12 @@ function AddressForm(
}
}
} else {
setValue(field.name, addressData[field.name])
setValue(
field.name,
addressData[field.name] === 'undefined'
? ''
: addressData[field.name]
)
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ export function AddressItemCard(props: OrderItemCardProps) {
<Typography variant="body1">{`${addressInfo.firstName} ${addressInfo.lastName}`}</Typography>
<Typography variant="body1">{addressInfo.company || ''}</Typography>
<Typography variant="body1">{addressInfo.addressLine1}</Typography>
<Typography variant="body1">{addressInfo.addressLine2}</Typography>
<Typography variant="body1">
{addressInfo.addressLine2 === 'undefined'
? ''
: addressInfo.addressLine2}
</Typography>
<Typography variant="body1">{`${addressInfo.city}, ${addressInfo.state} ${addressInfo.zipCode}, ${addressInfo.country}`}</Typography>
<Typography variant="body1">{addressInfo.phoneNumber}</Typography>

Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/shared/service/b2b/graphql/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const createCompanyUser = (data: any) => `mutation{
companyPhoneNumber: "${data.companyPhoneNumber || ''}",
country: "${data.country}",
addressLine1: "${data.addressLine1}",
addressLine2: "${data.addressLine2}",
addressLine2: "${data.addressLine2 || ''}",
city: "${data.city}",
state: "${data.state}",
zipCode: "${data.zip_code}",
Expand Down

0 comments on commit af91707

Please sign in to comment.