diff --git a/public/app/features/annotations/api.ts b/public/app/features/annotations/api.ts index b756628098d..cdbaab32faf 100644 --- a/public/app/features/annotations/api.ts +++ b/public/app/features/annotations/api.ts @@ -15,8 +15,8 @@ export function deleteAnnotation(annotation: AnnotationEvent) { } export async function getAnnotationTags() { - const tags: AnnotationTagsResponse[] = await getBackendSrv().get('/api/annotations/tags'); - return tags.map(({ tag, count }) => ({ + const response: AnnotationTagsResponse = await getBackendSrv().get('/api/annotations/tags'); + return response.result.tags.map(({ tag, count }) => ({ term: tag, count, })); diff --git a/public/app/features/annotations/types.ts b/public/app/features/annotations/types.ts index e1f0e0d1975..e0a53d516e9 100644 --- a/public/app/features/annotations/types.ts +++ b/public/app/features/annotations/types.ts @@ -19,7 +19,7 @@ export interface AnnotationQueryResponse { panelData?: PanelData; } -export interface AnnotationTagsResponse { +export interface AnnotationTag { /** * The tag name */ @@ -29,3 +29,9 @@ export interface AnnotationTagsResponse { */ count: number; } + +export interface AnnotationTagsResponse { + result: { + tags: AnnotationTag[]; + }; +}