1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[AC-2426] Allow editing of client organization name (#4072)

* Allow editing of client organization name

* Removing unnecessary using for linter
This commit is contained in:
Alex Morask
2024-05-14 11:26:08 -04:00
committed by GitHub
parent e93894a6fd
commit fd173e81b6
3 changed files with 59 additions and 5 deletions

View File

@ -133,10 +133,17 @@ public class ProviderClientsController(
return TypedResults.Problem();
}
await assignSeatsToClientOrganizationCommand.AssignSeatsToClientOrganization(
provider,
clientOrganization,
requestBody.AssignedSeats);
if (clientOrganization.Seats != requestBody.AssignedSeats)
{
await assignSeatsToClientOrganizationCommand.AssignSeatsToClientOrganization(
provider,
clientOrganization,
requestBody.AssignedSeats);
}
clientOrganization.Name = requestBody.Name;
await organizationRepository.ReplaceAsync(clientOrganization);
return TypedResults.Ok();
}

View File

@ -7,4 +7,7 @@ public class UpdateClientOrganizationRequestBody
[Required]
[Range(0, int.MaxValue, ErrorMessage = "You cannot assign negative seats to a client organization.")]
public int AssignedSeats { get; set; }
[Required]
public string Name { get; set; }
}