Skip to content

Commit

Permalink
chore: update changelog for a multistore (#7346)
Browse files Browse the repository at this point in the history
* chore: update changelog for a multistore
- add more verbose information about latest patches changes

* chore: update missing changelog description
  • Loading branch information
bartoszherba authored Dec 5, 2024
1 parent 47934c8 commit f9807f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/content/3.middleware/2.guides/4.federation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you want to retrieve a loaded integration within the context of another, you
Usage:

```javascript
const sapcc = context.getApiClient("sapcc");
const sapcc = await context.getApiClient("sapcc");
```

The `getApiClient` method takes a single argument, which is the key of the api client you wish to retrieve. This is the key you would define in the `middleware.config.js` file for the integration you wish to retrieve. The key is essentially an identifier for the integration.
Expand All @@ -38,7 +38,7 @@ export const integrations = {
extendApiMethods: {
getPDP: async (context, params: { id: string }) => {
const sapccApi = context.api; // You can access integration methods directly
const contentful = context.getApiClient("contentful"); // You can access other integrations using getApiClient
const contentful = await context.getApiClient("contentful"); // You can access other integrations using getApiClient

const [product, content] = Promise.all(
sapccApi.getProduct({ id: params.id }),
Expand Down Expand Up @@ -99,7 +99,7 @@ export const integrations = {
extendApiMethods: {
enrichedSearch: async (context, params: { productId: string }) => {
const sapccApi = context.api;
const legacyCustomSystem = context.getApiClient("legacyCustomSystem");
const legacyCustomSystem = await context.getApiClient("legacyCustomSystem");

const [prouctStock, product] = await Promise.all([
legacyCustomSystem.api.getProductStock({
Expand Down
6 changes: 6 additions & 0 deletions docs/content/3.middleware/4.reference/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ const { createApiClient } = apiClientFactory({
export { createApiClient };
```
- **[CHANGED]** - Middleware `getApiClient` is now an asynchronous function. Please, read the [data federation](https://docs.alokai.com/middleware/guides/federation#using-getapiclient-method-to-access-different-api-client) guide to get more information.
:::warning
This change may introduce breaking changes in some projects. Please ensure to update your project accordingly if necessary.
:::
## 4.0.1
### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
### Patch Changes

- Updated dependencies:
- @vue-storefront/middleware@5.1.0
- @vue-storefront/middleware@5.1.0 - Please refer to the [middleware changelog](https://docs.alokai.com/middleware/reference/change-log#_510) for more details.

## 4.1.1

### Patch Changes

- Updated dependencies:
- @vue-storefront/middleware@5.0.0
- @vue-storefront/middleware@5.0.0 - Please refer to the [middleware changelog](https://docs.alokai.com/middleware/reference/change-log#_500) for more details.

## 4.1.0

Expand Down

0 comments on commit f9807f5

Please sign in to comment.