From e32c8be0a4b7f135c01449c3603da347728819a8 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 21 Mar 2020 14:35:19 +0300 Subject: chore: migrate requests.ts --- src/requests.js | 24 ------------------------ src/requests.ts | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 src/requests.js create mode 100644 src/requests.ts diff --git a/src/requests.js b/src/requests.js deleted file mode 100644 index ad45dcf..0000000 --- a/src/requests.js +++ /dev/null @@ -1,24 +0,0 @@ -import axios from 'axios' - -const baseUrl = 'https://eugvs.pythonanywhere.com/'; -const baseApiUrl = baseUrl + 'api/'; - -export const get = (url) => { - return axios.get( - baseApiUrl + url, - ); -}; - -export const post = (url, data) => { - return axios.post( - baseApiUrl + url, - data - ); -}; - -export const del = (url, data) => { - return axios.delete( - baseApiUrl + url, - data - ) -}; diff --git a/src/requests.ts b/src/requests.ts new file mode 100644 index 0000000..eeb2ee7 --- /dev/null +++ b/src/requests.ts @@ -0,0 +1,24 @@ +import axios from 'axios' + +const baseUrl = 'https://eugvs.pythonanywhere.com/'; +const baseApiUrl = baseUrl + 'api/'; + +export const get = (url: string) => { + return axios.get( + baseApiUrl + url, + ); +}; + +export const post = (url: string, data: object) => { + return axios.post( + baseApiUrl + url, + data + ); +}; + +export const del = (url: string, data: object) => { + return axios.delete( + baseApiUrl + url, + data + ) +}; -- cgit v1.2.3