Skip to content

Commit 72daff8

Browse files
committed
fix type errors
1 parent 8ee9eea commit 72daff8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/skills/SkillsSectionContainer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ export default class SkillsSectionContainer extends React.Component<
9494

9595
async fetchRepos(): Promise<void> {
9696
try {
97-
const response = await Axios({
97+
const response: { data: Repo[] } = await Axios({
9898
...GITHUB_REPOS_REQUEST_CONFIG,
9999
cancelToken: this.axiosCancelSource.token
100100
});
101-
const { data } = response;
101+
const { data }: { data: Repo[] } = response;
102102
const { rawSkills } = this.props;
103103
const skills = processSkills(rawSkills, data);
104104

105105
this.setState({ loading: false, skills });
106106
} catch (err) {
107-
if (err.response) {
107+
if (Axios.isAxiosError(err) && err.response) {
108108
const { status, statusText } = err.response;
109109

110110
this.setState({

0 commit comments

Comments
 (0)