Improve handling of JSON objects in custom datasources

This commit is contained in:
Andrew Kingston 2023-10-05 19:30:00 +01:00
parent 549ea44245
commit 3564fd5621
1 changed files with 1 additions and 3 deletions

View File

@ -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
}