From ecc5bdd362f637c3deeb44527b109c21ebea4c0c Mon Sep 17 00:00:00 2001 From: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> Date: Tue, 12 Apr 2022 16:42:53 +0200 Subject: [PATCH] Only use country if part of a region (#1183) --- packages/medusa-plugin-ip-lookup/src/api/medusa-middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/medusa-plugin-ip-lookup/src/api/medusa-middleware.js b/packages/medusa-plugin-ip-lookup/src/api/medusa-middleware.js index 6853543085..54b51e940e 100644 --- a/packages/medusa-plugin-ip-lookup/src/api/medusa-middleware.js +++ b/packages/medusa-plugin-ip-lookup/src/api/medusa-middleware.js @@ -25,7 +25,7 @@ export default { }) // If country exists, add it to the body of the cart creation request - if (country) { + if (country?.region_id) { req.body.region_id = country.region_id req.body.country_code = country.iso_2 }