Change: Use the absence of "field" to refer to the root of customapi response
This commit is contained in:
parent
9b79d71ac7
commit
7b069cc51f
@ -57,8 +57,8 @@ widget:
|
|||||||
- field: key
|
- field: key
|
||||||
label: Number of things in array
|
label: Number of things in array
|
||||||
format: size
|
format: size
|
||||||
- field: . # This will take the root of the API response, e.g. when APIs return an array
|
# This (no field) will take the root of the API response, e.g. when APIs return an array:
|
||||||
label: Number of items
|
- label: Number of items
|
||||||
format: size
|
format: size
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ function getValue(field, data) {
|
|||||||
let key = "";
|
let key = "";
|
||||||
|
|
||||||
// Support APIs that return arrays or scalars directly.
|
// Support APIs that return arrays or scalars directly.
|
||||||
if (field === ".") {
|
if (typeof field === "undefined") {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user