mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Fixed: Use route Id for PUT requests if not passed in body
Closes #3133
This commit is contained in:
parent
4fd389021a
commit
2cc835d456
1 changed files with 6 additions and 0 deletions
|
@ -57,6 +57,12 @@ namespace Lidarr.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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue