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

Fixing compiler complaints.

This commit is contained in:
jrmccannon 2025-03-28 10:57:20 -05:00
parent e86dd00da5
commit f8b172ef32
No known key found for this signature in database
GPG Key ID: CF03F3DB01CE96A6

View File

@ -7,23 +7,26 @@ public interface IInviteUserOrganizationValidator : IValidator<InviteOrganizatio
public class InviteUserOrganizationValidator : IInviteUserOrganizationValidator
{
public async Task<ValidationResult<InviteOrganization>> ValidateAsync(InviteOrganization inviteOrganization)
public Task<ValidationResult<InviteOrganization>> ValidateAsync(InviteOrganization inviteOrganization)
{
if (inviteOrganization.Seats is null)
{
return new Valid<InviteOrganization>(inviteOrganization);
return Task.FromResult<ValidationResult<InviteOrganization>>(
new Valid<InviteOrganization>(inviteOrganization));
}
if (string.IsNullOrWhiteSpace(inviteOrganization.GatewayCustomerId))
{
return new Invalid<InviteOrganization>(new OrganizationNoPaymentMethodFoundError(inviteOrganization));
return Task.FromResult<ValidationResult<InviteOrganization>>(
new Invalid<InviteOrganization>(new OrganizationNoPaymentMethodFoundError(inviteOrganization)));
}
if (string.IsNullOrWhiteSpace(inviteOrganization.GatewaySubscriptionId))
{
return new Invalid<InviteOrganization>(new OrganizationNoSubscriptionFoundError(inviteOrganization));
return Task.FromResult<ValidationResult<InviteOrganization>>(
new Invalid<InviteOrganization>(new OrganizationNoSubscriptionFoundError(inviteOrganization)));
}
return new Valid<InviteOrganization>(inviteOrganization);
return Task.FromResult<ValidationResult<InviteOrganization>>(new Valid<InviteOrganization>(inviteOrganization));
}
}