mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 13:57:11 -04: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 @@ namespace Prowlarr.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…
Add table
Add a link
Reference in a new issue