From 6b5ddd99daf203a4bdb9f21e39bdf48bff78459a Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Tue, 4 Jun 2019 20:07:50 +0200 Subject: [PATCH] New emoji endpoint moved from profile to seasonedApi controller --- src/seasonedAPI.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/seasonedAPI.js b/src/seasonedAPI.js index a92c7b3..03d0e7d 100644 --- a/src/seasonedAPI.js +++ b/src/seasonedAPI.js @@ -56,7 +56,18 @@ const request = (id, type, authorization_token) => { const url = `${BASE_URL}v1/plex/request/${id}&type=${type}` const headers = { authorization: authorization_token } return axios.post(url, { headers: headers }) - .catch(error => console.log('error while requesting item:', error)) + .catch(error => { console.error(`api error requesting: ${id}, type: ${type}`); throw error }) } -export { getMovie, getShow, getListByName, search, searchTorrents, request } \ No newline at end of file + +// - - - Random emoji - - - + +const getEmoji = () => { + const url = `${BASE_URL}v1/emoji` + return axios.get(url) + .catch(error => { console.log('api error getting emoji'); throw error }) +} + + + +export { getMovie, getShow, getListByName, search, searchTorrents, request, getEmoji }