From 183bdca50ae4137ba969acd016021055bcd9d11e Mon Sep 17 00:00:00 2001 From: Kjetil Haugland Date: Thu, 24 Oct 2024 09:20:45 +0200 Subject: [PATCH] Renamed method --- .../Commands/OnboardedApps/OnboardApp/OnboardAppCommand.cs | 2 +- .../UpdateOnboardedApp/UpdateOnboardedAppCommand.cs | 2 +- .../Commands/Portals/CreatePortal/CreatePortalCommand.cs | 2 +- .../Commands/Portals/UpdatePortal/UpdatePortalCommand.cs | 2 +- .../Services/ContextTypeService/ContextTypeService.cs | 2 +- .../Services/ContextTypeService/IContextTypeService.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/OnboardApp/OnboardAppCommand.cs b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/OnboardApp/OnboardAppCommand.cs index 5234bbbad..1195c6be7 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/OnboardApp/OnboardAppCommand.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/OnboardApp/OnboardAppCommand.cs @@ -52,7 +52,7 @@ public async Task Handle(OnboardAppCommand command, CancellationToken canc try { - onboardedApp.AddContextTypes(await _contextTypeService.GetContextTypesByContextTypeKey(command.ContextTypes, cancellationToken)); + onboardedApp.AddContextTypes(await _contextTypeService.GetAllowedContextTypesByKeys(command.ContextTypes, cancellationToken)); } catch (InvalidActionException ex) { diff --git a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/UpdateOnboardedApp/UpdateOnboardedAppCommand.cs b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/UpdateOnboardedApp/UpdateOnboardedAppCommand.cs index bc2c94675..845dd1999 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/UpdateOnboardedApp/UpdateOnboardedAppCommand.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/OnboardedApps/UpdateOnboardedApp/UpdateOnboardedAppCommand.cs @@ -42,7 +42,7 @@ public async Task Handle(UpdateOnboardedAppCommand command, CancellationTo try { - entity.AddContextTypes(await _contextTypeService.GetContextTypesByContextTypeKey(command.ContextTypes, cancellationToken)); + entity.AddContextTypes(await _contextTypeService.GetAllowedContextTypesByKeys(command.ContextTypes, cancellationToken)); } catch (InvalidActionException ex) { diff --git a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/CreatePortal/CreatePortalCommand.cs b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/CreatePortal/CreatePortalCommand.cs index 5a047035e..73820066d 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/CreatePortal/CreatePortalCommand.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/CreatePortal/CreatePortalCommand.cs @@ -42,7 +42,7 @@ public async Task Handle(CreatePortalCommand command, CancellationToken ca var portal = new Portal(slug, command.Name, command.ShortName, command.SubText, command.Description, command.Icon); - portal.AddContextTypes(await _contextTypeService.GetContextTypesByContextTypeKey(command.ContextTypes, cancellationToken)); + portal.AddContextTypes(await _contextTypeService.GetAllowedContextTypesByKeys(command.ContextTypes, cancellationToken)); await _readWriteContext.Set().AddAsync(portal, cancellationToken); diff --git a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/UpdatePortal/UpdatePortalCommand.cs b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/UpdatePortal/UpdatePortalCommand.cs index 10d39732b..fb21af211 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/UpdatePortal/UpdatePortalCommand.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.Application/Commands/Portals/UpdatePortal/UpdatePortalCommand.cs @@ -55,7 +55,7 @@ public async Task Handle(UpdatePortalCommand command, CancellationToken ca entity.Update(slug, command.Name, command.ShortName, command.SubText, command.Description, command.Icon); - entity.AddContextTypes(await _contextTypeService.GetContextTypesByContextTypeKey(command.ContextTypes, cancellationToken)); + entity.AddContextTypes(await _contextTypeService.GetAllowedContextTypesByKeys(command.ContextTypes, cancellationToken)); await _readWriteContext.SaveChangesAsync(cancellationToken); diff --git a/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/ContextTypeService.cs b/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/ContextTypeService.cs index 5a8372f10..80c9691d0 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/ContextTypeService.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/ContextTypeService.cs @@ -14,7 +14,7 @@ public ContextTypeService(IReadWriteContext readWriteContext) _readWriteContext = readWriteContext; } - public async Task> GetContextTypesByContextTypeKey(IList contextTypeKeys, CancellationToken cancellationToken) + public async Task> GetAllowedContextTypesByKeys(IList contextTypeKeys, CancellationToken cancellationToken) { if (contextTypeKeys.Count == 0) { diff --git a/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/IContextTypeService.cs b/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/IContextTypeService.cs index e9369fde2..4c0415171 100644 --- a/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/IContextTypeService.cs +++ b/backend/src/Equinor.ProjectExecutionPortal.Application/Services/ContextTypeService/IContextTypeService.cs @@ -4,6 +4,6 @@ namespace Equinor.ProjectExecutionPortal.Application.Services.ContextTypeService { public interface IContextTypeService { - Task> GetContextTypesByContextTypeKey(IList contextTypeKeys, CancellationToken cancellationToken); + Task> GetAllowedContextTypesByKeys(IList contextTypeKeys, CancellationToken cancellationToken); } }