fixes for widget validation

pull/543/head
Michael Shamoon 2 years ago
parent 9d5e401fe2
commit 4ccf8eddae

@ -9,9 +9,9 @@ export default function validateWidgetData(widget, endpoint, data) {
valid = false;
}
if (dataParsed) {
if (dataParsed && Object.entries(dataParsed).length) {
const validate = widgets[widget.type]?.mappings?.[endpoint]?.validate;
validate.forEach(key => {
validate?.forEach(key => {
if (dataParsed[key] === undefined) {
valid = false;
}

@ -10,10 +10,7 @@ const widget = {
endpoint: "series",
map: (data) => ({
total: asJson(data).length,
}),
validate: [
"total"
]
})
},
queue: {
endpoint: "queue",

Loading…
Cancel
Save