Skip to content

Commit

Permalink
Merge pull request #224 from cvanem/main
Browse files Browse the repository at this point in the history
bugfix: Format customs fix to prevent null customs items from breaking HTTP request workflow
  • Loading branch information
KaseyCantu authored Jan 31, 2024
2 parents 6cef64d + 6b33280 commit 05cabe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/get-rates-with-shipment-details/format-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ function formatCustoms(
customs: Response.InternationalShipmentOptions
): GetRatesWithShipmentDetailsTypes.Result["customs"] | null {
return {
contents: customs.contents,
nonDelivery: customs.non_delivery,
customsItems: customs.customs_items
contents: customs?.contents,
nonDelivery: customs?.non_delivery,
customsItems: customs?.customs_items
? formatCustomsItems(customs.customs_items)
: null,
};
Expand Down

0 comments on commit 05cabe7

Please sign in to comment.