diff options
-rw-r--r-- | src/requests.ts | 21 |
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 - ) -}; |