mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-15 21:14:32 +01:00
Fixed: Use route Id for PUT requests if not passed in body
This commit is contained in:
parent
5d2fefde8f
commit
df13537e29
1 changed files with 6 additions and 0 deletions
|
|
@ -57,6 +57,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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue