1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 13:08:17 -05:00

fixing test.

This commit is contained in:
jrmccannon 2025-03-19 18:42:08 -05:00
parent 5b87fa629e
commit edbf1cea41
No known key found for this signature in database
GPG Key ID: CF03F3DB01CE96A6

View File

@ -102,16 +102,16 @@ public class PostUserCommand(
var result = await inviteOrganizationUsersCommand.InviteScimOrganizationUserAsync(request); var result = await inviteOrganizationUsersCommand.InviteScimOrganizationUserAsync(request);
var invitedUserId = result switch var invitedOrganizationUserId = result switch
{ {
Success<ScimInviteOrganizationUsersResponse> success => success.Value.InvitedUser.OrganizationId, Success<ScimInviteOrganizationUsersResponse> success => success.Value.InvitedUser.Id,
Failure<ScimInviteOrganizationUsersResponse> { ErrorMessage: InviteOrganizationUsersCommand.NoUsersToInvite } => (Guid?)null, Failure<ScimInviteOrganizationUsersResponse> { ErrorMessage: InviteOrganizationUsersCommand.NoUsersToInvite } => (Guid?)null,
Failure<ScimInviteOrganizationUsersResponse> failure when failure.ErrorMessages.Count != 0 => throw new BadRequestException(failure.ErrorMessage), Failure<ScimInviteOrganizationUsersResponse> failure when failure.ErrorMessages.Count != 0 => throw new BadRequestException(failure.ErrorMessage),
_ => throw new InvalidOperationException() _ => throw new InvalidOperationException()
}; };
var organizationUser = invitedUserId.HasValue var organizationUser = invitedOrganizationUserId.HasValue
? await organizationUserRepository.GetDetailsByIdAsync(invitedUserId.Value) ? await organizationUserRepository.GetDetailsByIdAsync(invitedOrganizationUserId.Value)
: null; : null;
return organizationUser; return organizationUser;