Annotations: Update to match backend api
This commit is contained in:
@@ -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,
|
||||
}));
|
||||
|
||||
@@ -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[];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user