Skip to content

Commit

Permalink
ui bug : delete api must include group id
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreLamarre committed Oct 25, 2023
1 parent 58f1397 commit 1e3d978
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web/pkg/opni/models/alerting/Condition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export class Condition extends Resource {
}

async remove() {
await deleteAlertCondition(this.id);
await deleteAlertCondition(this.id, this.groupId);
super.remove();
}

Expand Down
8 changes: 3 additions & 5 deletions web/pkg/opni/utils/requests/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { Reference } from '../../models/shared';
import {
AlertCondition, AlertConditionList, AlertDetailChoicesRequest, AlertStatusResponse, Condition, ConditionReference, ListAlarmMessageRequest, ListAlertTypeDetails, ListMessageResponse, ListStatusResponse, SilenceRequest, TimelineRequest, TimelineResponse, UpdateAlertConditionRequest
} from '../../models/alerting/Condition';
import {
AlertEndpoint, AlertEndpointList, Endpoint, UpdateAlertEndpointRequest
} from '../../models/alerting/Endpoint';
import { AlertEndpoint, AlertEndpointList, Endpoint, UpdateAlertEndpointRequest } from '../../models/alerting/Endpoint';
import { Cluster } from '../../models/Cluster';

export async function createAlertEndpoint(endpoint: AlertEndpoint) {
Expand Down Expand Up @@ -68,8 +66,8 @@ export async function getAlertConditionChoices(request: AlertDetailChoicesReques
return (await axios.post<ListAlertTypeDetails>('opni-api/AlertConditions/choices', request)).data;
}

export function deleteAlertCondition(id: string) {
return axios.delete(`opni-api/AlertConditions/configure`, { data: { id } });
export function deleteAlertCondition(id: string, groupId : string) {
return axios.delete(`opni-api/AlertConditions/configure`, { data: { id, groupId } });
}

export async function getAlertConditionStatus(id: string): Promise<AlertStatusResponse> {
Expand Down

0 comments on commit 1e3d978

Please sign in to comment.