Add alert rule editing UI
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import type {
|
||||
AlertRule,
|
||||
AlertRuleUpdate,
|
||||
Asset,
|
||||
CheckResult,
|
||||
Incident,
|
||||
@@ -85,6 +87,12 @@ export const api = {
|
||||
}),
|
||||
monitorResults: (token: string, monitorId: number, limit = 1) =>
|
||||
request<CheckResult[]>(`/monitors/${monitorId}/results?limit=${limit}`, token),
|
||||
alertRules: (token: string) => request<AlertRule[]>("/alerts/rules", token),
|
||||
updateAlertRule: (token: string, ruleId: number, payload: AlertRuleUpdate) =>
|
||||
request<AlertRule>(`/alerts/rules/${ruleId}`, token, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify(payload),
|
||||
}),
|
||||
incidents: (token: string) => request<Incident[]>("/incidents", token),
|
||||
acknowledgeIncident: (token: string, incidentId: number) =>
|
||||
request<Incident>(`/incidents/${incidentId}/acknowledge`, token, {
|
||||
|
||||
Reference in New Issue
Block a user