mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Use route Id for PUT requests if not passed in body
This commit is contained in:
@@ -57,6 +57,12 @@ namespace Prowlarr.Http.REST
|
|||||||
|
|
||||||
foreach (var resource in resourceArgs)
|
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);
|
ValidateResource(resource, skipValidate, skipShared);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user