diff --git a/docs/content/advanced/backend/upgrade-guides/1-7-0.md b/docs/content/advanced/backend/upgrade-guides/1-7-0.md new file mode 100644 index 0000000000000..9c706d1c4da61 --- /dev/null +++ b/docs/content/advanced/backend/upgrade-guides/1-7-0.md @@ -0,0 +1,35 @@ +--- +description: 'Actions Required for v.1.7.0' +--- + +# v1.7.0 + +Version `1.7.0` of Medusa introduces a breaking change in the [CustomerService](../../../references/services/classes/CustomerService.md). + +## Overview + +In this new version, the method [`retrieveByEmail` in the Customer Service](../../../references/services/classes/CustomerService.md#retrievebyemail) has been deprecated in favor of other methods. Read the actions required below to learn which methods to use instead. + +## Actions Required + +Instead of using `customerService.retrieveByEmail`, you should now use the methods `customerService.retrieveRegisteredByEmail` or `customerService.retrieveUnRegisteredByEmail`. + +The `customerService.retrieveRegisteredByEmail` method allows you to retrieve a registered customer by email: + +```tsx +customerService.retrieveRegisteredByEmail("example@gmail.com"); +``` + +On the other hand, the `retrieveUnregisteredByEmail` method allows to retrieve guest customers by email: + +```jsx +customerService.retrieveUnRegisteredByEmail("example@gmail.com"); +``` + +To retrieve a customer by email regardless of whether they are registered or not, you can use the `customerService.list` method instead: + +```tsx +customerService.list({ + email: "example@gmail.com" +}) +``` diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 4b8d2c4e14eba..24f20876c9bb1 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -194,6 +194,11 @@ module.exports = { id: "advanced/backend/upgrade-guides/1-6-1", label: "v1.6.1" }, + { + type: "doc", + id: "advanced/backend/upgrade-guides/1-7-0", + label: "v1.7.0" + }, ] }, {