From c2423cf715cb270821c40e5dc4bf50228789f348 Mon Sep 17 00:00:00 2001 From: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:38:16 +0200 Subject: [PATCH] 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 * Update docs/content/upgrade-guides/modules/product/1-2-0.md Co-authored-by: Shahed Nasser * Address pr comments * address pr comments * fix lint issue --------- Co-authored-by: Shahed Nasser --- .../upgrade-guides/modules/_category_.json | 5 ++ .../upgrade-guides/modules/product/1-2-0.md | 51 +++++++++++++++++++ .../modules/product/_category_.json | 6 +++ www/docs/sidebars.js | 14 +++++ 4 files changed, 76 insertions(+) create mode 100644 www/docs/content/upgrade-guides/modules/_category_.json create mode 100644 www/docs/content/upgrade-guides/modules/product/1-2-0.md create mode 100644 www/docs/content/upgrade-guides/modules/product/_category_.json diff --git a/www/docs/content/upgrade-guides/modules/_category_.json b/www/docs/content/upgrade-guides/modules/_category_.json new file mode 100644 index 0000000000..45ed2f544d --- /dev/null +++ b/www/docs/content/upgrade-guides/modules/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 4, + "link": null, + "label": "Modules" +} \ No newline at end of file diff --git a/www/docs/content/upgrade-guides/modules/product/1-2-0.md b/www/docs/content/upgrade-guides/modules/product/1-2-0.md new file mode 100644 index 0000000000..2786e658a4 --- /dev/null +++ b/www/docs/content/upgrade-guides/modules/product/1-2-0.md @@ -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"], +}) +``` diff --git a/www/docs/content/upgrade-guides/modules/product/_category_.json b/www/docs/content/upgrade-guides/modules/product/_category_.json new file mode 100644 index 0000000000..073b547744 --- /dev/null +++ b/www/docs/content/upgrade-guides/modules/product/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Product Module", + "customProps": { + "reverse": true + }, +} \ No newline at end of file diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 442cd98bf8..e7354b3bdf 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -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",