From ce58e6ecdb89f3cb26b4331fc0747c0e30c47fbc Mon Sep 17 00:00:00 2001 From: nitsua Date: Sun, 14 Feb 2021 10:28:30 -0500 Subject: [PATCH] Fixed: Mark as Failed errors Co-Authored-By: Mark McDowall (cherry picked from commit a9792973eef960e8310a611cf1da2d2cada57532) --- frontend/src/Store/Actions/authorHistoryActions.js | 8 ++------ frontend/src/Store/Actions/bookHistoryActions.js | 8 ++------ frontend/src/Store/Actions/historyActions.js | 5 +---- src/Readarr.Api.V1/History/HistoryController.cs | 4 ++-- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/frontend/src/Store/Actions/authorHistoryActions.js b/frontend/src/Store/Actions/authorHistoryActions.js index f22374ab3..2b1c53edc 100644 --- a/frontend/src/Store/Actions/authorHistoryActions.js +++ b/frontend/src/Store/Actions/authorHistoryActions.js @@ -78,12 +78,8 @@ export const actionHandlers = handleThunks({ } = payload; const promise = createAjaxRequest({ - url: '/history/failed', - method: 'POST', - data: { - id: historyId - }, - dataType: 'json' + url: `/history/failed/${historyId}`, + method: 'POST' }).request; promise.done(() => { diff --git a/frontend/src/Store/Actions/bookHistoryActions.js b/frontend/src/Store/Actions/bookHistoryActions.js index aecea42f4..9726c7aef 100644 --- a/frontend/src/Store/Actions/bookHistoryActions.js +++ b/frontend/src/Store/Actions/bookHistoryActions.js @@ -86,12 +86,8 @@ export const actionHandlers = handleThunks({ } = payload; const promise = createAjaxRequest({ - url: '/history/failed', - method: 'POST', - data: { - id: historyId - }, - dataType: 'json' + url: `/history/failed/${historyId}`, + method: 'POST' }).request; promise.done(() => { diff --git a/frontend/src/Store/Actions/historyActions.js b/frontend/src/Store/Actions/historyActions.js index 71b99b63b..0f778f5b4 100644 --- a/frontend/src/Store/Actions/historyActions.js +++ b/frontend/src/Store/Actions/historyActions.js @@ -246,11 +246,8 @@ export const actionHandlers = handleThunks({ })); const promise = createAjaxRequest({ - url: '/history/failed', + url: `/history/failed/${id}`, method: 'POST', - data: { - id - }, dataType: 'json' }).request; diff --git a/src/Readarr.Api.V1/History/HistoryController.cs b/src/Readarr.Api.V1/History/HistoryController.cs index 77b04cd1e..656efc296 100644 --- a/src/Readarr.Api.V1/History/HistoryController.cs +++ b/src/Readarr.Api.V1/History/HistoryController.cs @@ -99,8 +99,8 @@ namespace Readarr.Api.V1.History return _historyService.GetByAuthor(authorId, eventType).Select(h => MapToResource(h, includeAuthor, includeBook)).ToList(); } - [HttpPost("failed")] - public object MarkAsFailed([FromBody] int id) + [HttpPost("failed/{id}")] + public object MarkAsFailed([FromRoute] int id) { _failedDownloadService.MarkAsFailed(id); return new { };