Skip to content

Commit

Permalink
fix: Save line_2 value properly
Browse files Browse the repository at this point in the history
  • Loading branch information
acasazza committed Jan 31, 2022
1 parent b27d573 commit 4689e90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/components/BillingAddressForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ const BillingAddressForm: FunctionComponent<BillingAddressFormProps> = (
})
}
}
console.log('values', values)
setAddress({
values: {
...values,
Expand Down
11 changes: 5 additions & 6 deletions src/utils/PropsType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ type Defined<T> = T extends undefined ? never : T
* So, instead we take the union type in cases when a property in defaultProps does not extend
* the corresponding property in the Props declaration.
*/
type WithDefaultProps<P, DP> = Omit<P, keyof DP> &
{
[K in Extract<keyof DP, keyof P>]: DP[K] extends Defined<P[K]>
? Defined<P[K]>
: Defined<P[K]> | DP[K]
}
type WithDefaultProps<P, DP> = Omit<P, keyof DP> & {
[K in Extract<keyof DP, keyof P>]: DP[K] extends Defined<P[K]>
? Defined<P[K]>
: Defined<P[K]> | DP[K]
}

/**
* Get the props type from propTypes and defaultProps.
Expand Down
3 changes: 0 additions & 3 deletions src/utils/validateFormFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,8 @@ const businessOptionalFields: BusinessOptionalField[] = [

const customerOptionalFields: CustomerOptionalField[] = [
'billing_address_company',
'billing_address_line_2',
'shipping_address_company',
'shipping_address_line_2',
'company',
'line_2',
]

export function businessMandatoryField(
Expand Down

0 comments on commit 4689e90

Please sign in to comment.