Skip to content

Commit

Permalink
fix(getNewFreight): Correct error if new shipping is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Dec 20, 2023
1 parent 07fa122 commit 6a3eeea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions functions/lib/galaxpay/update-subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ const getNewFreight = async (storeId, itemsOrder, to, subtotal, shippingLineOrig
service: service || (sameApp.response?.shipping_services && sameApp.response?.shipping_services[0])
}
} else {
if (!result[0]?.response?.shipping_services.length) return null

let minPrice = result[0]?.response?.shipping_services[0]?.shipping_line?.total_price
const indexPosition = { app: 0, service: 0 }
for (let i = 0; i < result.length; i++) {
Expand Down

0 comments on commit 6a3eeea

Please sign in to comment.