From 5d6e7a6178f0c3662b897bd7f58821bd7ecf5dc4 Mon Sep 17 00:00:00 2001 From: rozetko Date: Wed, 18 Jan 2023 19:00:47 +0300 Subject: [PATCH] hotfix --- src/services/exporter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/exporter.ts b/src/services/exporter.ts index a1fe347..e35bbb3 100644 --- a/src/services/exporter.ts +++ b/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'); } }