aboutsummaryrefslogtreecommitdiff
path: root/src/requests.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-03-21 15:20:41 +0300
committereug-vs <eug-vs@keemail.me>2020-03-21 15:20:41 +0300
commit2ca9cbb36e25e280a1b26c9dc03eaea30e1dcc9d (patch)
tree53429fdf101d4ee0dc43e910fc41d2cc4502a198 /src/requests.ts
parentef3f55d8396218a41b48c4ed10a5e515ac320e5c (diff)
downloadchrono-cube-ui-2ca9cbb36e25e280a1b26c9dc03eaea30e1dcc9d.tar.gz
refactor: improve requests.ts
Diffstat (limited to 'src/requests.ts')
-rw-r--r--src/requests.ts21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/requests.ts b/src/requests.ts
index 961d8d6..0242ed5 100644
--- a/src/requests.ts
+++ b/src/requests.ts
@@ -3,22 +3,9 @@ import axios, { AxiosResponse } from 'axios';
const baseUrl = 'https://eugvs.pythonanywhere.com/';
const baseApiUrl = baseUrl + 'api/';
-export const get = (url: string): Promise<AxiosResponse> => {
- return axios.get(
- baseApiUrl + url,
- );
-};
+export const get = (url: string): Promise<AxiosResponse> => axios.get(baseApiUrl + url);
-export const post = (url: string, data: object): Promise<AxiosResponse> => {
- return axios.post(
- baseApiUrl + url,
- data
- );
-};
+export const del = (url: string): Promise<AxiosResponse> => axios.delete(baseApiUrl + url);
+
+export const post = (url: string, data: object): Promise<AxiosResponse> => axios.post(baseApiUrl + url, data);
-export const del = (url: string, data: object): Promise<AxiosResponse> => {
- return axios.delete(
- baseApiUrl + url,
- data
- )
-};