Skip to content

Commit 02089ac

Browse files
authored
Merge pull request #698 from akeneo/fix-snippet-line-length
fix snippet line length & misc
2 parents e32fa21 + a874978 commit 02089ac

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

content/apps/create-app/activate-nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ app.get('/activate', (req, res, next) => {
5151
} catch (err) {
5252
next(err);
5353
}
54-
}
54+
});
5555

5656
```

content/apps/create-app/callback-nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ app.get('/callback', async (req, res, next) => {
6464
} catch (err) {
6565
next(err);
6666
}
67-
}
67+
});
6868

6969
```

content/tutorials/guides/how-to-get-families-and-attributes.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ $client = new \GuzzleHttp\Client([
9696
Get families and attribute codes by requesting the PIM API
9797

9898
```php [activate:PHP]
99+
99100
const API_URL = '/api/rest/v1/families?search={"has_products":[{"operator":"=","value":true}]}';
100101

101102
// Make an authenticated call to the API
@@ -110,7 +111,10 @@ while (array_key_exists('next', $data['_links'])) {
110111
$response = $client->get($data['_links']['next']['href']);
111112
$data = json_decode($response->getBody()->getContents(), true);
112113
$families = array_merge($families, $data['_embedded']['items']);
113-
$attributeCodes = array_merge($attributeCodes, ...array_column($data['_embedded']['items'], 'attributes'));
114+
$attributeCodes = array_merge(
115+
$attributeCodes,
116+
...array_column($data['_embedded']['items'], 'attributes')
117+
);
114118
}
115119

116120
$attributeCodes = array_unique($attributeCodes);
@@ -136,6 +140,7 @@ This step is mandatory if you want to synchronize product variants later. If not
136140
Get family variants by requesting the PIM API for each families
137141

138142
```php [activate:PHP]
143+
139144
const MAX_ITEMS = 100;
140145
const API_URL = '/api/rest/v1/families/%s/variants?limit=' . MAX_ITEMS;
141146

@@ -159,6 +164,7 @@ saveVariants($variants);
159164
Remember your <b>attribute_code_list</b>? It’s (already) time to use it to retrieve attribute information
160165

161166
```php [activate:PHP]
167+
162168
const MAX_ITEMS = 100;
163169
const API_URL = '/api/rest/v1/attributes?search={"code":[{"operator":"IN","value":%s}]}&limit=' . MAX_ITEMS;
164170

@@ -190,4 +196,4 @@ saveAttributes($attributes);
190196
::: warning
191197
attribute_code_list may be significant, very big! If you get an <a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.15" target="_blank" rel="noopener noreferrer">HTTP 414 error</a>
192198
, you probably hit these boundaries. A workaround is to split your attribute_code_list into different parts and call them independently.
193-
:::
199+
:::

content/tutorials/guides/how-to-retrieve-pim-structure.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ $channel = json_decode($response->getBody()->getContents(), true);
113113

114114
```javascript [activate:NodeJS]
115115

116-
import fetch from 'node-fetch';
117-
118116
const pimUrl = 'https://url-of-your-pim.com';
119117
const accessToken = 'your_app_token'; // Token provided during oAuth steps
120118

0 commit comments

Comments
 (0)