mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 13:08:17 -05:00
fixing test.
This commit is contained in:
parent
5b87fa629e
commit
edbf1cea41
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user