1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13:00

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

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
}