refactor: add response state to condition
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
This commit is contained in:
co-authored by
Piotr Jamróz
parent
1dfb9e0430
commit
0a167ab00b
@@ -81,7 +81,11 @@ export const QueryEditorField = ({ dsUid, invalid, error, name }: Props) => {
|
||||
|
||||
if (datasource) {
|
||||
runRequest(datasource, transaction.request).subscribe((panelData) => {
|
||||
if (!panelData || panelData.state === 'Error' || panelData.series.length === 0) {
|
||||
if (
|
||||
!panelData ||
|
||||
panelData.state === 'Error' ||
|
||||
(panelData.state === 'Done' && panelData.series.length === 0)
|
||||
) {
|
||||
setIsValidQuery(false);
|
||||
} else if (
|
||||
panelData.state === 'Done' &&
|
||||
|
||||
Reference in New Issue
Block a user