Improve handling of JSON objects in custom datasources
This commit is contained in:
parent
549ea44245
commit
3564fd5621
|
@ -36,9 +36,7 @@ export default class CustomFetch extends DataFetch {
|
||||||
if (typeof data === "string") {
|
if (typeof data === "string") {
|
||||||
try {
|
try {
|
||||||
const js = JSON.parse(data)
|
const js = JSON.parse(data)
|
||||||
if (Array.isArray(js)) {
|
return Array.isArray(js) ? js : [js]
|
||||||
return js
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Ignore
|
// Ignore
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue