Skip to content

Commit 04db154

Browse files
authored
ref(hybrid-cloud): use monitor urls with org slug frontend (#42728)
1 parent c482b2c commit 04db154

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

static/app/views/monitors/details.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ class MonitorDetails extends AsyncView<Props, State> {
3535

3636
getEndpoints(): ReturnType<AsyncView['getEndpoints']> {
3737
const {params, location} = this.props;
38-
return [['monitor', `/monitors/${params.monitorId}/`, {query: location.query}]];
38+
return [
39+
[
40+
'monitor',
41+
`/monitors/${this.orgSlug}/${params.monitorId}/`,
42+
{query: location.query},
43+
],
44+
];
3945
}
4046

4147
getTitle() {
@@ -68,14 +74,14 @@ class MonitorDetails extends AsyncView<Props, State> {
6874
<DatePageFilter alignDropdown="left" />
6975
</StyledPageFilterBar>
7076

71-
<MonitorStats monitor={monitor} />
77+
<MonitorStats monitor={monitor} orgId={this.orgSlug} />
7278

7379
<MonitorIssues monitor={monitor} orgId={this.orgSlug} />
7480

7581
<Panel>
7682
<PanelHeader>{t('Recent Check-ins')}</PanelHeader>
7783

78-
<MonitorCheckIns monitor={monitor} />
84+
<MonitorCheckIns monitor={monitor} orgId={this.orgSlug} />
7985
</Panel>
8086
</Fragment>
8187
)}

static/app/views/monitors/monitorCheckIns.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,21 @@ type CheckIn = {
2121

2222
type Props = {
2323
monitor: Monitor;
24+
orgId: string;
2425
};
2526

2627
type State = {
2728
checkInList: CheckIn[];
2829
};
2930

30-
const MonitorCheckIns = ({monitor}: Props) => {
31+
const MonitorCheckIns = ({monitor, orgId}: Props) => {
3132
const {data, hasError, renderComponent} = useApiRequests<State>({
3233
endpoints: [
33-
['checkInList', `/monitors/${monitor.id}/checkins/`, {query: {per_page: '10'}}],
34+
[
35+
'checkInList',
36+
`/monitors/${orgId}/${monitor.id}/checkins/`,
37+
{query: {per_page: '10'}},
38+
],
3439
],
3540
});
3641

static/app/views/monitors/monitorStats.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ import {Monitor, MonitorStat} from './types';
1717

1818
type Props = {
1919
monitor: Monitor;
20+
orgId: string;
2021
};
2122

2223
type State = {
2324
stats: MonitorStat[] | null;
2425
};
2526

26-
const MonitorStats = ({monitor}: Props) => {
27+
const MonitorStats = ({monitor, orgId}: Props) => {
2728
const {selection} = usePageFilters();
2829
const {start, end, period} = selection.datetime;
2930

@@ -41,7 +42,7 @@ const MonitorStats = ({monitor}: Props) => {
4142
endpoints: [
4243
[
4344
'stats',
44-
`/monitors/${monitor.id}/stats/`,
45+
`/monitors/${orgId}/${monitor.id}/stats/`,
4546
{
4647
query: {
4748
since: since.toString(),

0 commit comments

Comments
 (0)