From 52ac3e4e4ecfff7b061b09291995c70d7455c283 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 21 May 2023 22:24:12 +0200 Subject: [PATCH] Proper Mapping for deleting and dequeueing --- Tranga-API/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tranga-API/Program.cs b/Tranga-API/Program.cs index 5681423..0b5ba2e 100644 --- a/Tranga-API/Program.cs +++ b/Tranga-API/Program.cs @@ -58,7 +58,7 @@ app.MapPost("/Tasks/Create", (string taskType, string? connectorName, string? pu taskManager.AddTask(task, connectorName, publication, TimeSpan.Parse(reoccurrenceTime), language??""); }); -app.MapPost("/Tasks/Delete", (string taskType, string? connectorName, string? publicationId) => +app.MapDelete("/Tasks/Delete", (string taskType, string? connectorName, string? publicationId) => { Publication? publication = taskManager.GetAllPublications().FirstOrDefault(pub => pub.internalId == publicationId); TrangaTask.Task task = Enum.Parse(taskType); @@ -93,7 +93,7 @@ app.MapPost("/Queue/Enqueue", (string taskType, string? connectorName, string? p taskManager.AddTaskToQueue(task); }); -app.MapPost("/Queue/Dequeue", (string taskType, string? connectorName, string? publicationId) => +app.MapDelete("/Queue/Dequeue", (string taskType, string? connectorName, string? publicationId) => { TrangaTask.Task pTask = Enum.Parse(taskType); TrangaTask? task = taskManager.GetAllTasks().FirstOrDefault(tTask =>