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

Closes #3133
pull/3119/head
Qstick 2 years ago
parent 4fd389021a
commit 2cc835d456

@ -57,6 +57,12 @@ namespace Lidarr.Http.REST
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);
}
}

Loading…
Cancel
Save