Browse Source

hotfix

pull/6/head
rozetko 2 years ago
parent
commit
5d6e7a6178
  1. 6
      src/services/exporter.ts

6
src/services/exporter.ts

@ -129,15 +129,15 @@ export class Exporter {
}
private _validateQueries(queries: DashboardQuery[]) {
if(!queries || !Array.isArray(queries)) {
if(!_.isArray(queries)) {
throw new Error('`queries` field is required and should be an array');
}
for(const query of queries) {
if(!_.isEmpty(query.datasource)) {
if(_.isEmpty(query.datasource)) {
throw new Error('all queries should have a `datasource` field');
}
if(!_.isEmpty(query.panel.targets)) {
if(_.isEmpty(query.panel.targets)) {
throw new Error('all queries should have a `panel` field with non-empty `targets` field');
}
}

Loading…
Cancel
Save