Alerting: Fixes incorrect cache invalidation for silences when no silences exist (#92322)
This commit is contained in:
@@ -26,8 +26,14 @@ export const alertSilencesApi = alertingApi.injectEndpoints({
|
||||
accesscontrol: accessControl,
|
||||
},
|
||||
}),
|
||||
providesTags: (result) =>
|
||||
result ? result.map(({ id }) => ({ type: 'AlertmanagerSilences', id })) : ['AlertmanagerSilences'],
|
||||
providesTags: (result) => {
|
||||
return result
|
||||
? [
|
||||
...result.map(({ id }) => ({ type: 'AlertmanagerSilences' as const, id })),
|
||||
{ type: 'AlertmanagerSilences' },
|
||||
]
|
||||
: [{ type: 'AlertmanagerSilences' }];
|
||||
},
|
||||
}),
|
||||
|
||||
getSilence: build.query<
|
||||
|
||||
Reference in New Issue
Block a user