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") {
|
||||
try {
|
||||
const js = JSON.parse(data)
|
||||
if (Array.isArray(js)) {
|
||||
return js
|
||||
}
|
||||
return Array.isArray(js) ? js : [js]
|
||||
} catch (error) {
|
||||
// Ignore
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue