rm axios dep

This commit is contained in:
Collin M. Barrett 2019-08-03 14:11:46 -05:00
parent c0207b9a6f
commit 2a349459da
3 changed files with 21 additions and 16 deletions

Binary file not shown.

View file

@ -9,7 +9,6 @@
"@types/react-dom": "16.8.5",
"@types/react-router-dom": "^4.3.4",
"@types/react-table": "^6.8.5",
"axios": "^0.19.0",
"bootstrap": "^4.3.1",
"es6-promise": "^4.2.8",
"moment": "^2.24.0",

View file

@ -1,4 +1,3 @@
import axios from "axios";
import * as React from "react";
import { Home } from "./Home";
import { ILicense } from "./interfaces/ILicense";
@ -46,38 +45,45 @@ export class HomeContainer extends React.Component<{}, IState> {
};
fetchLanguages() {
axios.request<Language[]>({ url: "/api/v1/languages" })
.then(l => { this.setState({ languages: l.data }); })
fetch("/api/v1/languages")
.then(response => response.json())
.then(json => { this.setState({ languages: json }); })
};
fetchLicenses() {
axios.request<ILicense[]>({ url: "/api/v1/licenses" })
.then(l => { this.setState({ licenses: l.data }); })
fetch("/api/v1/licenses")
.then(response => response.json())
.then(json => { this.setState({ licenses: json }); })
};
fetchLists() {
axios.request<IList[]>({ url: "/api/v1/lists" })
.then(l => { this.setState({ lists: l.data }); })
fetch("/api/v1/lists")
.then(response => response.json())
.then(json => { this.setState({ lists: json }); })
};
fetchMaintainers() {
axios.request<IMaintainer[]>({ url: "/api/v1/maintainers" })
.then(l => { this.setState({ maintainers: l.data }); })
fetch("/api/v1/maintainers")
.then(response => response.json())
.then(json => { this.setState({ maintainers: json }); })
};
fetchSoftware() {
axios.request<ISoftware[]>({ url: "/api/v1/software" })
.then(l => { this.setState({ software: l.data }); })
fetch("/api/v1/software")
.then(response => response.json())
.then(json => { this.setState({ software: json }); })
};
fetchSyntaxes() {
axios.request<ISyntax[]>({ url: "/api/v1/syntaxes" })
.then(l => { this.setState({ syntaxes: l.data }); })
fetch("/api/v1/syntaxes")
.then(response => response.json())
.then(json => { this.setState({ syntaxes: json }); })
};
fetchTags() {
axios.request<ITag[]>({ url: "/api/v1/tags" })
.then(l => { this.setState({ tags: l.data }); })
fetch("/api/v1/tags")
.then(response => response.json())
.then(json => { this.setState({ tags: json }); })
};
render() {