Skip to content

Commit 8f7ab69

Browse files
authored
feat(ts): Add Client type to withAPI (#14475)
1 parent acce406 commit 8f7ab69

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/sentry/static/sentry/app/utils/withApi.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ const withApi = <P extends object>(WrappedComponent: React.ComponentType<P>) =>
1818
this.api.clear();
1919
}
2020

21-
// TODO(ts): Update this when API client is typed
22-
private api: any;
21+
private api: Client;
2322

2423
render() {
25-
return <WrappedComponent api={this.api as any} {...this.props as P} />;
24+
return <WrappedComponent api={this.api} {...this.props as P} />;
2625
}
2726
};
2827
};

src/sentry/static/sentry/app/views/settings/projectIncidentRules/ruleForm.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
33
import React from 'react';
44
import styled from 'react-emotion';
55

6+
import {Client} from 'app/api';
67
import {Config, EventsStatsData, Organization, Project} from 'app/types';
78
import {PanelAlert} from 'app/components/panels';
89
import {addErrorMessage} from 'app/actionCreators/indicator';
@@ -27,7 +28,7 @@ import {IncidentRule} from './types';
2728
import IncidentRulesChart from './chart';
2829

2930
type Props = {
30-
api: any;
31+
api: Client;
3132
config: Config;
3233
data: EventsStatsData;
3334
organization: Organization;
@@ -404,7 +405,7 @@ class RuleForm extends React.Component<Props, State> {
404405
}
405406

406407
type RuleFormContainerProps = {
407-
api: any;
408+
api: Client;
408409
config: Config;
409410
organization: Organization;
410411
project: Project;

0 commit comments

Comments
 (0)