mirror of
https://github.com/bitwarden/server
synced 2026-01-06 18:43:36 +00:00
Properly handle new policy enrollments in the public API (#4003)
* Test the use case * Properly instantiate model from null * Rename query parameter
This commit is contained in:
@@ -83,7 +83,7 @@ public class PoliciesController : Controller
|
||||
/// </remarks>
|
||||
/// <param name="type">The type of policy to be updated.</param>
|
||||
/// <param name="model">The request model.</param>
|
||||
[HttpPut("{id}")]
|
||||
[HttpPut("{type}")]
|
||||
[ProducesResponseType(typeof(PolicyResponseModel), (int)HttpStatusCode.OK)]
|
||||
[ProducesResponseType(typeof(ErrorResponseModel), (int)HttpStatusCode.BadRequest)]
|
||||
[ProducesResponseType((int)HttpStatusCode.NotFound)]
|
||||
@@ -93,7 +93,7 @@ public class PoliciesController : Controller
|
||||
_currentContext.OrganizationId.Value, type);
|
||||
if (policy == null)
|
||||
{
|
||||
policy = model.ToPolicy(_currentContext.OrganizationId.Value);
|
||||
policy = model.ToPolicy(_currentContext.OrganizationId.Value, type);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user