From 6f4c2dc3eb2f2d5b7901f0475697336eb2e73ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cdorac-ext=E2=80=9D?= <103416234+doracretu3pillar@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:11:18 +0300 Subject: [PATCH] Fixed the popup error --- public/app/features/alerting/unified/api/alertmanager.ts | 6 +++--- public/app/features/alerting/unified/api/alertmanagerApi.ts | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/public/app/features/alerting/unified/api/alertmanager.ts b/public/app/features/alerting/unified/api/alertmanager.ts index 27d080a6c4a0b..708a289162abb 100644 --- a/public/app/features/alerting/unified/api/alertmanager.ts +++ b/public/app/features/alerting/unified/api/alertmanager.ts @@ -237,9 +237,9 @@ function getReceiverResultError(receiversResult: TestReceiversResult) { export async function addAlertManagers(alertManagerConfig: ExternalAlertmanagerConfig): Promise { 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, }) @@ -263,7 +263,7 @@ export async function fetchExternalAlertmanagerConfig(): Promise({ method: 'GET', - url: '/api/v1/ngalert/admin_config', + url: '/api/v1/provisioning/alert-rules', showErrorAlert: false, }) ); diff --git a/public/app/features/alerting/unified/api/alertmanagerApi.ts b/public/app/features/alerting/unified/api/alertmanagerApi.ts index c0c710922109c..020de02153b70 100644 --- a/public/app/features/alerting/unified/api/alertmanagerApi.ts +++ b/public/app/features/alerting/unified/api/alertmanagerApi.ts @@ -96,17 +96,16 @@ export const alertmanagerApi = alertingApi.injectEndpoints({ }), getExternalAlertmanagerConfig: build.query({ - query: () => ({ url: '/api/v1/ngalert/admin_config' }), + query: () => ({ url: '/api/v1/provisioning/alert-rules' }), providesTags: ['AlertmanagerChoice'], }), - getExternalAlertmanagers: build.query({ 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'], }),