Skip to content

Commit

Permalink
Swapped out the call to OrgDomainService to be OrgDomainRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmccannon committed Oct 15, 2024
1 parent 38b6b35 commit f91d28c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class PolicyService : IPolicyService
private readonly ISsoConfigRepository _ssoConfigRepository;
private readonly IMailService _mailService;
private readonly GlobalSettings _globalSettings;
private readonly IOrganizationDomainService _organizationDomainService;
private readonly IOrganizationDomainRepository _organizationDomainRepository;
private readonly ITwoFactorIsEnabledQuery _twoFactorIsEnabledQuery;

public PolicyService(
Expand All @@ -37,7 +37,7 @@ public PolicyService(
ISsoConfigRepository ssoConfigRepository,
IMailService mailService,
GlobalSettings globalSettings,
IOrganizationDomainService organizationDomainService,
IOrganizationDomainRepository organizationDomainRepository,
ITwoFactorIsEnabledQuery twoFactorIsEnabledQuery)
{
_applicationCacheService = applicationCacheService;
Expand All @@ -48,7 +48,7 @@ public PolicyService(
_ssoConfigRepository = ssoConfigRepository;
_mailService = mailService;
_globalSettings = globalSettings;
_organizationDomainService = organizationDomainService;
_organizationDomainRepository = organizationDomainRepository;
_twoFactorIsEnabledQuery = twoFactorIsEnabledQuery;
}

Expand Down Expand Up @@ -258,7 +258,7 @@ private async Task HandleDependentPoliciesAsync(Policy policy, Organization org)

private async Task HasNoVerifiedDomainsAsync(Organization org)
{
if (await _organizationDomainService.HasVerifiedDomainsAsync(org.Id))
if ((await _organizationDomainRepository.GetDomainsByOrganizationIdAsync(org.Id)).Count > 0)
{
throw new BadRequestException("Organization still has verified domains.");

Check warning on line 263 in src/Core/AdminConsole/Services/Implementations/PolicyService.cs

View check run for this annotation

Codecov / codecov/patch

src/Core/AdminConsole/Services/Implementations/PolicyService.cs#L262-L263

Added lines #L262 - L263 were not covered by tests
}
Expand Down

0 comments on commit f91d28c

Please sign in to comment.