Annotations: Update to match backend api

This commit is contained in:
Ashley Harrison
2021-06-30 15:16:49 +01:00
parent ac5b56a7e4
commit b2507f5231
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -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,
}));
+7 -1
View File
@@ -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[];
};
}