Skip to content

Commit

Permalink
fix: relax shipping rates schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gciotola committed Jan 3, 2025
1 parent adb4bdb commit 006662b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/app-elements/src/helpers/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ const rateSchema = z.object({
/** currency for the rate */
currency: z.string(),
/** delivery days for this service */
delivery_days: z.number(),
delivery_days: z.number().optional(),
/** date for delivery */
delivery_date: z.string(),
delivery_date: z.string().optional(),
/** *This field is deprecated and should be ignored. @deprecated */
est_delivery_days: z.number(),
est_delivery_days: z.number().optional(),
/** formatted date for delivery */
formatted_delivery_date: z.string(),
formatted_delivery_date: z.string().optional(),
/** the actual formatted rate quote for this service */
formatted_rate: z.string()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const Tracking = withSkeletonTemplate<{
</Text>
</FlexRow>
)}
{showEstimatedDelivery && rate != null && (
{showEstimatedDelivery && rate?.formatted_delivery_date != null && (
<FlexRow className='mt-4'>
<Text variant='info'>Estimated delivery</Text>
<Text weight='semibold'>{rate.formatted_delivery_date}</Text>
Expand Down

0 comments on commit 006662b

Please sign in to comment.