mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 12:13:15 +08:00
Annotations: Fix sql annotation parsing for empty responses (#35367)
* fix sql annotation parsing for empty responses * fix backend when no data returned * add back frontend changes Co-authored-by: Ying WANG <ying.wang@grafana.com>
This commit is contained in:
@ -37,6 +37,9 @@ export default class ResponseParser {
|
||||
|
||||
async transformAnnotationResponse(options: any, data: BackendDataSourceResponse): Promise<AnnotationEvent[]> {
|
||||
const frames = toDataQueryResponse({ data: data }).data as DataFrame[];
|
||||
if (!frames || !frames.length) {
|
||||
return [];
|
||||
}
|
||||
const frame = frames[0];
|
||||
const timeField = frame.fields.find((f) => f.name === 'time');
|
||||
|
||||
|
Reference in New Issue
Block a user