Skip to content

Commit

Permalink
docs: added an upgrade guide for 1.7.0 (#2750)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Dec 13, 2022
1 parent 29135c0 commit beecd49
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/content/advanced/backend/upgrade-guides/1-7-0.md
Original file line number Diff line number Diff line change
@@ -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("[email protected]");
```

On the other hand, the `retrieveUnregisteredByEmail` method allows to retrieve guest customers by email:

```jsx
customerService.retrieveUnRegisteredByEmail("[email protected]");
```

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: "[email protected]"
})
```
5 changes: 5 additions & 0 deletions www/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
]
},
{
Expand Down

0 comments on commit beecd49

Please sign in to comment.