1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-26 22:56:23 -04:00

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

This commit is contained in:
Qstick
2022-11-28 20:26:38 -06:00
parent 528feb14c9
commit becc567ff7
2 changed files with 9 additions and 2 deletions
+6
View File
@@ -70,6 +70,12 @@ namespace Sonarr.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);
}
}