-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53a00e1
commit 251395f
Showing
3 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
"@vue-storefront/magento-sdk": patch | ||
--- | ||
|
||
[CHANGED] `magentoModule` has been deprecated. Use `middlewareModule` from `@vue-storefront/sdk` package instead. | ||
|
||
```diff | ||
- import { initSDK, buildModule } from '@vue-storefront/sdk'; | ||
- import { magentoModule } from '@vsf-enterprise/magento-sdk' | ||
+ import { initSDK, buildModule, middlewareModule } from '@vue-storefront/sdk'; | ||
+ import { Endpoints as MagentoEndpoints } from '@vsf-enterprise/sapcc-api'; // In Alokai Storefront you should import it from `storefront-middleware/types.ts` | ||
|
||
const sdkConfig = { | ||
magento: | ||
buildModule( | ||
- magentoModule, | ||
+ middlewareModule<MagentoEndpoints>, | ||
{ apiUrl: 'http://localhost:8181/magento' } | ||
) | ||
}; | ||
``` | ||
|
||
Updating your `magentoModule` to this version should not disrupt your existing code; however, switching to `middlewareModule` will require certain modifications. | ||
|
||
To migrate: | ||
|
||
- Use custom query as a second argument of `middlewareModule` function. | ||
|
||
```diff | ||
const customQuery = { | ||
cart: 'cart-custom-query', | ||
metadata: { | ||
fields: 'id items { uid }' | ||
} | ||
}; | ||
- const cart = await sdk.magento.cart({ cartId: '123'}, { customQuery }); | ||
+ const cart = await sdk.magento.cart({ cartId: '123'}, customQuery); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@vue-storefront/magento-api": patch | ||
--- | ||
|
||
[CHANGED] Update TSDocs of API methods. Now, they contain examples of usage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters