File tree Expand file tree Collapse file tree
server/src/internal/products/productUtils/productResponseUtils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export const getPlanResponse = async ({
6464} ) : Promise < ApiPlanV1 > => {
6565 // 1. Convert prices/entitlements to items
6666 const rawItems = mapToProductItems ( {
67- prices : product . prices ,
67+ prices : product . prices ?? [ ] ,
6868 entitlements : product . entitlements ?? [ ] ,
6969 features : features ,
7070 } ) ;
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ const getProductProperties = ({
152152 is_one_off : isOneOffProduct ( { product } ) ,
153153 interval_group : largestInterval ?. interval ,
154154 has_trial : hasFreeTrial ,
155- updateable : product . prices . some (
155+ updateable : ( product . prices ?? [ ] ) . some (
156156 ( p : Price ) =>
157157 isPrepaidPrice ( p ) && p . config . interval !== BillingInterval . OneOff ,
158158 ) ,
@@ -178,7 +178,7 @@ export const getProductResponse = async ({
178178} ) => {
179179 // 1. Get items with display
180180 const rawItems = mapToProductItems ( {
181- prices : product . prices ,
181+ prices : product . prices ?? [ ] ,
182182 entitlements : product . entitlements ?? [ ] ,
183183 features : features ,
184184 } ) ;
You can’t perform that action at this time.
0 commit comments