temba 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,22 +246,20 @@ To change the response body of a `GET` request, configure a `responseBodyInterce
|
|
|
246
246
|
|
|
247
247
|
```js
|
|
248
248
|
const config = {
|
|
249
|
-
responseBodyInterceptor: (resourceName,
|
|
250
|
-
|
|
249
|
+
responseBodyInterceptor: (resourceName, responseBody, id) => {
|
|
250
|
+
if (resourceName === 'movies') {
|
|
251
251
|
if (id) {
|
|
252
252
|
// responseBody is an object
|
|
253
253
|
return {
|
|
254
254
|
...responseBody,
|
|
255
255
|
stuff: 'more stuff',
|
|
256
256
|
}
|
|
257
|
-
}
|
|
257
|
+
} else {
|
|
258
258
|
// responseBody is an array
|
|
259
|
-
return responseBody.map(x => (
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
))
|
|
259
|
+
return responseBody.map((x) => ({
|
|
260
|
+
...x,
|
|
261
|
+
stuff: 'more stuff',
|
|
262
|
+
}))
|
|
265
263
|
}
|
|
266
264
|
}
|
|
267
265
|
|