From f33f6645a347ed7d45e839fb848081d7f2f522af Mon Sep 17 00:00:00 2001 From: Phil Schneider Date: Wed, 13 Nov 2024 16:25:14 +0100 Subject: [PATCH] fix: adjust retrigger check (#124) Refs: #111 Reviewed-By: Evelyn Gurschler --- src/web/Dim.Web/BusinessLogic/DimBusinessLogic.cs | 4 ++-- src/web/Dim.Web/Controllers/DimController.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/web/Dim.Web/BusinessLogic/DimBusinessLogic.cs b/src/web/Dim.Web/BusinessLogic/DimBusinessLogic.cs index 4746e1f..e8cb076 100644 --- a/src/web/Dim.Web/BusinessLogic/DimBusinessLogic.cs +++ b/src/web/Dim.Web/BusinessLogic/DimBusinessLogic.cs @@ -216,10 +216,10 @@ public async Task RetriggerProcess(ProcessTypeId processTypeId, Guid processId, throw new NotFoundException($"process {processId} does not exist"); } - var context = processData.CreateManualProcessData(stepToTrigger, dimRepositories, () => $"processId {processId}"); - + var context = processData.CreateManualProcessData(processStepTypeId, dimRepositories, () => $"processId {processId}"); context.ScheduleProcessSteps(Enumerable.Repeat(stepToTrigger, 1)); context.FinalizeProcessStep(); + await dimRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None); } } diff --git a/src/web/Dim.Web/Controllers/DimController.cs b/src/web/Dim.Web/Controllers/DimController.cs index 642a32a..5a0a826 100644 --- a/src/web/Dim.Web/Controllers/DimController.cs +++ b/src/web/Dim.Web/Controllers/DimController.cs @@ -109,7 +109,7 @@ public static RouteGroupBuilder MapDimApi(this RouteGroupBuilder group) .RequireAuthorization(r => r.RequireRole("get_process")) .Produces(StatusCodes.Status200OK, contentType: Constants.JsonContentType); - dim.MapGet("process/wallet/{processId}/retrigger", ( + dim.MapPost("process/wallet/{processId}/retrigger", ( [FromRoute] Guid processId, [FromQuery] ProcessStepTypeId processStepTypeId, [FromServices] IDimBusinessLogic dimBusinessLogic) @@ -122,7 +122,7 @@ public static RouteGroupBuilder MapDimApi(this RouteGroupBuilder group) .RequireAuthorization(r => r.RequireRole("retrigger_process")) .Produces(StatusCodes.Status200OK, contentType: Constants.JsonContentType); - dim.MapGet("process/technicalUser/{processId}/retrigger", ( + dim.MapPost("process/technicalUser/{processId}/retrigger", ( [FromRoute] Guid processId, [FromQuery] ProcessStepTypeId processStepTypeId, [FromServices] IDimBusinessLogic dimBusinessLogic)