From 50c19104558d88b29110362b8c8c271cba97e942 Mon Sep 17 00:00:00 2001 From: shevijacobson Date: Sun, 27 Oct 2024 15:27:31 +0200 Subject: [PATCH] Add response format conversion for multiple tasks retrieval in GetMultiple function Signed-off-by: shevijacobson --- api/task.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/task.go b/api/task.go index 6ca63297..872ce712 100644 --- a/api/task.go +++ b/api/task.go @@ -136,6 +136,14 @@ func (h TaskHandler) GetMultiple(ctx *gin.Context) { return } + // Convert the retrieved tasks to the response format + var response []Task + for _, task := range tasks { + r := Task{} + r.With(&task) + response = append(response, r) + } // Respond with the list of tasks + h.Respond(ctx, http.StatusOK, response) }