aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-03-21 15:06:30 +0300
committereug-vs <eug-vs@keemail.me>2020-03-21 15:06:30 +0300
commitf3a684937565f3bd94034f3389aa95fea908f0c4 (patch)
treec01492bf8c06dc5409f9d8a30e807786dea90308 /src
parentde2a49bf1bf0e4c2f09ddcd0f2a86dff7062d8ea (diff)
downloadchrono-cube-ui-f3a684937565f3bd94034f3389aa95fea908f0c4.tar.gz
chore: fix linting errors :rotating_light:
Diffstat (limited to 'src')
-rw-r--r--src/pages/Contribute/Contribute.tsx3
-rw-r--r--src/pages/Scoreboard/Scoreboard.tsx4
-rw-r--r--src/requests.ts8
-rw-r--r--src/types.d.ts4
4 files changed, 7 insertions, 12 deletions
diff --git a/src/pages/Contribute/Contribute.tsx b/src/pages/Contribute/Contribute.tsx
index 854c5c1..4c37fb9 100644
--- a/src/pages/Contribute/Contribute.tsx
+++ b/src/pages/Contribute/Contribute.tsx
@@ -16,8 +16,8 @@ import BugReportIcon from '@material-ui/icons/BugReport';
import NewReleasesIcon from '@material-ui/icons/NewReleases';
import { Window, ContentSection } from 'react-benzin';
-import { Developer } from '../../types';
+import developers from '../../developers.json';
const useStyles = makeStyles(theme => ({
mono: {
@@ -32,7 +32,6 @@ const useStyles = makeStyles(theme => ({
}));
-const developers: Developer[] = require('../../developers.json');
const Contribute: React.FC = () => {
diff --git a/src/pages/Scoreboard/Scoreboard.tsx b/src/pages/Scoreboard/Scoreboard.tsx
index c6826d2..9b9ee01 100644
--- a/src/pages/Scoreboard/Scoreboard.tsx
+++ b/src/pages/Scoreboard/Scoreboard.tsx
@@ -34,13 +34,13 @@ const Scoreboard: React.FC = () => {
const classes = useStyles();
const [solutions, setSolutions] = useState<Solution[]>([]);
- const updateSolutions = () => {
+ const updateSolutions = (): void => {
get('scoreboard/').then(response => {
setSolutions(response.data);
});
};
- const removeSolution = (id: number) => {
+ const removeSolution = (id: number): void => {
updateSolutions();
};
diff --git a/src/requests.ts b/src/requests.ts
index eeb2ee7..961d8d6 100644
--- a/src/requests.ts
+++ b/src/requests.ts
@@ -1,22 +1,22 @@
-import axios from 'axios'
+import axios, { AxiosResponse } from 'axios';
const baseUrl = 'https://eugvs.pythonanywhere.com/';
const baseApiUrl = baseUrl + 'api/';
-export const get = (url: string) => {
+export const get = (url: string): Promise<AxiosResponse> => {
return axios.get(
baseApiUrl + url,
);
};
-export const post = (url: string, data: object) => {
+export const post = (url: string, data: object): Promise<AxiosResponse> => {
return axios.post(
baseApiUrl + url,
data
);
};
-export const del = (url: string, data: object) => {
+export const del = (url: string, data: object): Promise<AxiosResponse> => {
return axios.delete(
baseApiUrl + url,
data
diff --git a/src/types.d.ts b/src/types.d.ts
index fb3d86e..cfc60bc 100644
--- a/src/types.d.ts
+++ b/src/types.d.ts
@@ -10,7 +10,3 @@ export interface Solution {
author: User;
}
-export interface Developer {
- username: string;
- role: string;
-}