From 74704fbdee14874fb6ad71b37d914686cc42fb5f Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 30 Jun 2019 22:35:31 +0200 Subject: [PATCH] Changed AddManget endpoint url to use URL class instance to construct location --- src/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.js b/src/api.js index 5e80fba..948a32f 100644 --- a/src/api.js +++ b/src/api.js @@ -103,7 +103,7 @@ const searchTorrents = (query, authorization_token) => { * @returns {object} Success/Failure response */ const addMagnet = (magnet, name, tmdb_id) => { - const url = path.join(SEASONED_URL, 'v1/pirate/add') + const url = new URL('v1/pirate/add', SEASONED_URL) const body = { magnet: magnet, @@ -112,7 +112,7 @@ const addMagnet = (magnet, name, tmdb_id) => { } const headers = { authorization: storage.token } - return axios.post(url, body, { headers: headers }) + return axios.post(url.href, body, { headers: headers }) .catch(error => { console.error(`api error adding magnet: ${name}`); throw error }) }