mirror of
https://github.com/bitwarden/server.git
synced 2025-07-10 04:14:41 -05:00
add api support for updating org identifier (#861)
* add api support for updating org identifier * add identifier to response as well * implement in EF repo
This commit is contained in:
@ -885,6 +885,15 @@ namespace Bit.Core.Services
|
||||
throw new ApplicationException("Cannot create org this way. Call SignUpAsync.");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(organization.Identifier))
|
||||
{
|
||||
var orgById = await _organizationRepository.GetByIdentifierAsync(organization.Identifier);
|
||||
if (orgById != null && orgById.Id != organization.Id)
|
||||
{
|
||||
throw new BadRequestException("Identifier already in use by another organization.");
|
||||
}
|
||||
}
|
||||
|
||||
await ReplaceAndUpdateCache(organization, EventType.Organization_Updated);
|
||||
|
||||
if (updateBilling && !string.IsNullOrWhiteSpace(organization.GatewayCustomerId))
|
||||
|
Reference in New Issue
Block a user