docs: Add 1.2.0 upgrade guide for Product Module (#4981)
* docs: Add 1.2.0 upgrade guide for Product Module * Update docs/content/upgrade-guides/modules/product/1-2-0.md Co-authored-by: Shahed Nasser <shahednasser@gmail.com> * Update docs/content/upgrade-guides/modules/product/1-2-0.md Co-authored-by: Shahed Nasser <shahednasser@gmail.com> * Address pr comments * address pr comments * fix lint issue --------- Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
This commit is contained in:
co-authored by
Shahed Nasser
parent
40d9c9479c
commit
c2423cf715
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"position": 4,
|
||||
"link": null,
|
||||
"label": "Modules"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
description: 'Actions Required for v.1.2.0'
|
||||
sidebar_custom_props:
|
||||
iconName: 'server-stack-solid'
|
||||
---
|
||||
|
||||
# v1.2.0
|
||||
|
||||
Version 1.2.0 of the Product Module introduces minor breaking changes to the `ProductService`.
|
||||
|
||||
## Overview
|
||||
|
||||
This release contains breaking change to the methods `list` and `listAndCount` in the `ProductService` of the Product Module.
|
||||
|
||||
Specifically, the category filter that the service methods accept has changed from `category_ids` to `category_id`.
|
||||
|
||||
---
|
||||
|
||||
## How to Update
|
||||
|
||||
Run the following command in your project:
|
||||
|
||||
```bash npm2yarn
|
||||
npm install @medusajs/product@1.2.0
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Actions Required
|
||||
|
||||
### Change usage of Product Module
|
||||
|
||||
If you've applied the category filter to the `list` or `listAndCount` methods of the Product Module, you will need to change it as follows:
|
||||
|
||||
```ts
|
||||
// Before
|
||||
ProductService.list({
|
||||
category_ids: ["pcat_123", "pcat_456"],
|
||||
})
|
||||
ProductService.listAndCount({
|
||||
category_ids: ["pcat_123", "pcat_456"],
|
||||
})
|
||||
|
||||
// Now
|
||||
ProductService.list({
|
||||
category_id: ["pcat_123", "pcat_456"],
|
||||
})
|
||||
ProductService.listAndCount({
|
||||
category_id: ["pcat_123", "pcat_456"],
|
||||
})
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"label": "Product Module",
|
||||
"customProps": {
|
||||
"reverse": true
|
||||
},
|
||||
}
|
||||
@@ -1866,6 +1866,20 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Modules",
|
||||
collapsible: false,
|
||||
customProps: {
|
||||
sidebar_is_group_headline: true,
|
||||
},
|
||||
items: [
|
||||
{
|
||||
type: "autogenerated",
|
||||
dirName: "upgrade-guides/modules",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Plugins",
|
||||
|
||||
Reference in New Issue
Block a user