diff --git a/app/src/api.js b/app/src/api.js index ff39571a..93959a25 100644 --- a/app/src/api.js +++ b/app/src/api.js @@ -37,6 +37,7 @@ async function apiCall(url, method, body, ms = 60_000) { // Request encountered an error. let copy = response.clone(); const content = await copy.json(); + console.debug('API error response json', content); const code = content['code']; if (response.status === 403 && code === 'WROL_MODE_ENABLED') { toast({ @@ -463,11 +464,7 @@ export async function postDownload(urls, downloader, frequency, sub_downloader, body['tag_names'] = tagNames; } let response = await apiPost(`${API_URI}/download`, body); - if (response.status !== 204) { - const content = await response.json(); - console.error(content); - throw Error(content['error']); - } + return response; } export async function killDownload(download_id) { diff --git a/app/src/components/Common.js b/app/src/components/Common.js index 44a0915e..87a89d4f 100644 --- a/app/src/components/Common.js +++ b/app/src/components/Common.js @@ -1295,7 +1295,7 @@ export function useAPIButton( // Create button with or without theme. Pass all props to the