Files
medusa-store/docs/content/advanced/backend/upgrade-guides/1-7-0.md
Shahed Nasser d1b4b11ff6 chore(docs): added eslint to lint documentation code blocks (#2920)
* docs: added rule for code length

* chore: fixes based on vale errors

* changed to use eslint

* fixes using eslint

* added github action for documentation eslint

* changed allowed max-length

* fixed incorrect heading level

* removed comment
2022-12-30 18:44:46 +02:00

50 lines
1.6 KiB
Markdown

---
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.
In addition, after introducing the Claim Order feature, this version of Medusa introduces changes in the database that allows two customers having the same email based on the value of the `has_account` field. This change requires running migrations after the update.
---
## Actions Required
### Run Migrations
Run the following command to run migrations:
```bash
medusa migrations run
```
### Change Used Methods
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:
```ts
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:
```ts
customerService.list({
email: "example@gmail.com",
})
```