2025-04-01 10:38:02 +09:00

24 lines
704 B
TypeScript

import { getIrmIfPresentOrIncidentPluginId } from '../utils/config';
import { alertingApi } from './alertingApi';
interface IncidentsPluginConfigDto {
isChatOpsInstalled: boolean;
isIncidentCreated: boolean;
}
const getProxyApiUrl = (path: string) => `/api/plugins/${getIrmIfPresentOrIncidentPluginId()}/resources${path}`;
export const incidentsApi = alertingApi.injectEndpoints({
endpoints: (build) => ({
getIncidentsPluginConfig: build.query<IncidentsPluginConfigDto, void>({
query: () => ({
url: getProxyApiUrl('/api/ConfigurationTrackerService.GetConfigurationTracker'),
data: {},
method: 'POST',
showErrorAlert: false,
}),
}),
}),
});