mirror of
https://github.com/bitwarden/server.git
synced 2025-04-04 20:50:21 -05:00
Using GetPlanOrThrow instead.
This commit is contained in:
parent
b933007f09
commit
a1bd46febf
@ -28,8 +28,7 @@ public class PostUserCommand(
|
||||
IFeatureService featureService,
|
||||
IInviteOrganizationUsersCommand inviteOrganizationUsersCommand,
|
||||
TimeProvider timeProvider,
|
||||
IPricingClient pricingClient,
|
||||
ILogger<PostUserCommand> logger)
|
||||
IPricingClient pricingClient)
|
||||
: IPostUserCommand
|
||||
{
|
||||
public async Task<OrganizationUserUserDetails?> PostUserAsync(Guid organizationId, ScimUserRequestModel model)
|
||||
@ -54,26 +53,17 @@ public class PostUserCommand(
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
var plan = await pricingClient.GetPlan(organization.PlanType);
|
||||
|
||||
if (plan == null)
|
||||
{
|
||||
logger.LogError("Plan {planType} not found for organization {organizationId}",
|
||||
organization.PlanType, organization.Id);
|
||||
return null;
|
||||
}
|
||||
var plan = await pricingClient.GetPlanOrThrow(organization.PlanType);
|
||||
|
||||
var hasSecretsManagerStandalone = await paymentService.HasSecretsManagerStandalone(organization);
|
||||
|
||||
var request = model.ToRequest(
|
||||
scimProvider: scimProvider,
|
||||
inviteOrganization: new InviteOrganization(organization, plan),
|
||||
performedAt: timeProvider.GetUtcNow(),
|
||||
hasSecretsManagerStandalone);
|
||||
performedAt: timeProvider.GetUtcNow());
|
||||
|
||||
var orgUsers =
|
||||
await organizationUserRepository.GetManyDetailsByOrganizationAsync(
|
||||
request.InviteOrganization.OrganizationId);
|
||||
var orgUsers = await organizationUserRepository
|
||||
.GetManyDetailsByOrganizationAsync(request.InviteOrganization.OrganizationId);
|
||||
|
||||
if (orgUsers.Any(existingUser =>
|
||||
request.Invites.First().Email.Equals(existingUser.Email, StringComparison.OrdinalIgnoreCase) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user