From e2b6f2a5bb1d799a93c75a592d83ccaf04033d00 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Fri, 9 Sep 2022 13:20:59 +0200 Subject: [PATCH] [EC-529] fix: missing constructor DI assignment (#2258) * [EC-529] fix: missing constructor DI assignment * [EC-239] fix: move logging to CiphersController --- src/Api/Controllers/CiphersController.cs | 6 ++++++ src/Core/Services/Implementations/CipherService.cs | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Api/Controllers/CiphersController.cs b/src/Api/Controllers/CiphersController.cs index 5b059a332..47ecb536d 100644 --- a/src/Api/Controllers/CiphersController.cs +++ b/src/Api/Controllers/CiphersController.cs @@ -222,6 +222,12 @@ public class CiphersController : Controller var responses = orgCiphers.Select(c => new CipherMiniDetailsResponseModel(c, _globalSettings, collectionCiphersGroupDict, c.OrganizationUseTotp)); + var providerId = await _currentContext.ProviderIdForOrg(orgIdGuid); + if (providerId.HasValue) + { + await _providerService.LogProviderAccessToOrganizationAsync(orgIdGuid); + } + return new ListResponseModel(responses); } diff --git a/src/Core/Services/Implementations/CipherService.cs b/src/Core/Services/Implementations/CipherService.cs index e2679e628..d114ba416 100644 --- a/src/Core/Services/Implementations/CipherService.cs +++ b/src/Core/Services/Implementations/CipherService.cs @@ -31,7 +31,6 @@ public class CipherService : ICipherService private const long _fileSizeLeeway = 1024L * 1024L; // 1MB private readonly IReferenceEventService _referenceEventService; private readonly ICurrentContext _currentContext; - private readonly IProviderService _providerService; public CipherService( ICipherRepository cipherRepository, @@ -876,12 +875,6 @@ public class CipherService : ICipherService .Where(c => orgCipherIds.Contains(c.CipherId)) .GroupBy(c => c.CipherId).ToDictionary(s => s.Key); - var providerId = await _currentContext.ProviderIdForOrg(organizationId); - if (providerId.HasValue) - { - await _providerService.LogProviderAccessToOrganizationAsync(organizationId); - } - return (orgCiphers, collectionCiphersGroupDict); }