Skip to content

Commit 900c2b7

Browse files
committed
updated response for monitor incidents with error reason
1 parent 3875586 commit 900c2b7

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

apps/dashboard/src/api/endpoints/incidents/incidents.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,34 @@ export async function getIncidents(
4040
}
4141

4242

43+
export interface MonitorIncident {
44+
id: string;
45+
teamId: number;
46+
monitorId: number;
47+
title: string;
48+
description: string;
49+
createdAt: string;
50+
updatedAt: string;
51+
property: string;
52+
target: string;
53+
operator: string;
54+
}
55+
56+
/*
57+
Get Team Incidents
58+
*/
59+
60+
export interface GetMonitorIncidentsResponse {
61+
incidents: MonitorIncident[];
62+
}
63+
64+
4365
export async function getMonitorIncidents(
4466
teamId: number,
4567
monitorId: number,
4668
offset?: number,
4769
limit?: number,
48-
): Promise<GetIncidentsResponse> {
70+
): Promise<GetMonitorIncidentsResponse> {
4971
const response = await client.get(`/v1/teams/${teamId}/incidents/monitor/${monitorId}`,
5072
{
5173
params: {

apps/dashboard/src/pages/Dashboard/Incidents/components/IncidentsList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import {
1111
import { FunctionComponent } from "react";
1212
import { IoOpenOutline, IoStatsChart } from "react-icons/io5";
1313
import { useNavigate } from "react-router-dom";
14-
import { Incident } from "../../../../../src/api/endpoints/incidents";
14+
import { MonitorIncident } from "../../../../../src/api/endpoints/incidents";
1515

1616
interface MonitorIncidentPageIncidentsListProps {
17-
incidents?: Incident[];
17+
incidents?: MonitorIncident[];
1818
}
1919

2020
const IncidentPageIncidentsList: FunctionComponent<
@@ -32,7 +32,7 @@ MonitorIncidentPageIncidentsListProps
3232
};
3333

3434
interface IncidentsListItemProps {
35-
incident: Incident;
35+
incident: MonitorIncident;
3636
}
3737

3838
const IncidentsListItem: FunctionComponent<IncidentsListItemProps> = (
@@ -65,7 +65,7 @@ const IncidentsListItem: FunctionComponent<IncidentsListItemProps> = (
6565
>
6666
<Grid item>
6767
<Stack spacing={1}>
68-
<Typography variant="body2">{incident.title}</Typography>
68+
<Typography variant="body2">ERROR: {incident.title} {incident.operator} {incident.target}</Typography>
6969

7070
<Stack direction="row" spacing={1}>
7171
<Chip size="small" label="api" color="info" />

0 commit comments

Comments
 (0)