1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-20 18:02:44 +01:00

Fixed: Use route Id for PUT requests if not passed in body

Fixes #7809
This commit is contained in:
Qstick 2022-12-05 21:07:39 -06:00
parent 1751bd1a58
commit 4cc98a10a0

View File

@ -69,6 +69,12 @@ public override void OnActionExecuting(ActionExecutingContext context)
foreach (var resource in resourceArgs)
{
// Map route Id to body resource if not set in request
if (Request.Method == "PUT" && resource.Id == 0 && context.RouteData.Values.TryGetValue("id", out var routeId))
{
resource.Id = Convert.ToInt32(routeId);
}
ValidateResource(resource, skipValidate, skipShared);
}
}