mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add tag invalidation to updateRule mutation
...so the alert detail view updates appropriately
This commit is contained in:
parent
9ca2f7bece
commit
b037236b9c
@ -180,6 +180,7 @@ export const alertRuleApi = alertingApi.injectEndpoints({
|
||||
transformResponse: (response: PromRulesResponse, _, args): RuleNamespace[] => {
|
||||
return groupRulesByFileName(response.data.groups, args.ruleSourceName);
|
||||
},
|
||||
providesTags: ['AlertRulerRule'],
|
||||
}),
|
||||
|
||||
rulerRules: build.query<
|
||||
@ -190,6 +191,7 @@ export const alertRuleApi = alertingApi.injectEndpoints({
|
||||
const { path, params } = rulerUrlBuilder(rulerConfig).rules(filter);
|
||||
return { url: path, params };
|
||||
},
|
||||
providesTags: ['AlertRulerRule'],
|
||||
}),
|
||||
|
||||
// TODO This should be probably a separate ruler API file
|
||||
@ -201,6 +203,7 @@ export const alertRuleApi = alertingApi.injectEndpoints({
|
||||
const { path, params } = rulerUrlBuilder(rulerConfig).namespaceGroup(namespace, group);
|
||||
return { url: path, params };
|
||||
},
|
||||
providesTags: ['AlertRulerRule'],
|
||||
}),
|
||||
|
||||
exportRules: build.query<string, ExportRulesParams>({
|
||||
@ -270,6 +273,7 @@ export const alertRuleApi = alertingApi.injectEndpoints({
|
||||
data: payload,
|
||||
method: 'POST',
|
||||
}),
|
||||
invalidatesTags: ['AlertRulerRule'],
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
@ -38,6 +38,7 @@ export const alertingApi = createApi({
|
||||
'OnCallIntegrations',
|
||||
'OrgMigrationState',
|
||||
'DataSourceSettings',
|
||||
'AlertRulerRule',
|
||||
],
|
||||
endpoints: () => ({}),
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user