Skip to content

Commit

Permalink
Fixed the popup error
Browse files Browse the repository at this point in the history
  • Loading branch information
doracretu3pillar committed Jun 10, 2024
1 parent 9fd88d9 commit 6f4c2dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions public/app/features/alerting/unified/api/alertmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ function getReceiverResultError(receiversResult: TestReceiversResult) {
export async function addAlertManagers(alertManagerConfig: ExternalAlertmanagerConfig): Promise<void> {
await lastValueFrom(
getBackendSrv().fetch({
method: 'POST',
method: 'PUT',
data: alertManagerConfig,
url: '/api/v1/ngalert/admin_config',
url: '/api/v1/provisioning/alert-rules',
showErrorAlert: false,
showSuccessAlert: false,
})
Expand All @@ -263,7 +263,7 @@ export async function fetchExternalAlertmanagerConfig(): Promise<ExternalAlertma
const result = await lastValueFrom(
getBackendSrv().fetch<ExternalAlertmanagerConfig>({
method: 'GET',
url: '/api/v1/ngalert/admin_config',
url: '/api/v1/provisioning/alert-rules',
showErrorAlert: false,
})
);
Expand Down
5 changes: 2 additions & 3 deletions public/app/features/alerting/unified/api/alertmanagerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,16 @@ export const alertmanagerApi = alertingApi.injectEndpoints({
}),

getExternalAlertmanagerConfig: build.query<ExternalAlertmanagerConfig, void>({
query: () => ({ url: '/api/v1/ngalert/admin_config' }),
query: () => ({ url: '/api/v1/provisioning/alert-rules' }),
providesTags: ['AlertmanagerChoice'],
}),

getExternalAlertmanagers: build.query<ExternalAlertmanagers, void>({
query: () => ({ url: '/api/v1/ngalert/alertmanagers' }),
transformResponse: (response: ExternalAlertmanagersResponse) => response.data,
}),

saveExternalAlertmanagersConfig: build.mutation<{ message: string }, ExternalAlertmanagerConfig>({
query: (config) => ({ url: '/api/v1/ngalert/admin_config', method: 'POST', data: config }),
query: (config) => ({ url: '/api/v1/provisioning/alert-rules', method: 'PUT', data: config }),
invalidatesTags: ['AlertmanagerChoice'],
}),

Expand Down

0 comments on commit 6f4c2dc

Please sign in to comment.