From dfe3f389ad34acabe362ac3a46297c9a4881d0d2 Mon Sep 17 00:00:00 2001 From: bianyucheng Date: Fri, 5 Jul 2024 15:30:52 +0800 Subject: [PATCH] updates func need use map[string]interface{} --- sqle/api/controller/v1/workflow.go | 4 ++-- sqle/model/task.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sqle/api/controller/v1/workflow.go b/sqle/api/controller/v1/workflow.go index 284244f137..083d450d0e 100644 --- a/sqle/api/controller/v1/workflow.go +++ b/sqle/api/controller/v1/workflow.go @@ -891,7 +891,7 @@ func TerminateMultipleTaskByWorkflowV1(c echo.Context) error { } err = s.UpdateTaskStatusByIDs(terminatingTaskIDs, - map[string]string{"status": model.TaskStatusTerminating}) + map[string]interface{}{"status": model.TaskStatusTerminating}) return c.JSON(http.StatusOK, controller.NewBaseReq(err)) } @@ -955,7 +955,7 @@ func TerminateSingleTaskByWorkflowV1(c echo.Context) error { } err = s.UpdateTaskStatusByIDs([]uint{uint(taskID)}, - map[string]string{"status": model.TaskStatusTerminating}) + map[string]interface{}{"status": model.TaskStatusTerminating}) return c.JSON(http.StatusOK, controller.NewBaseReq(err)) } diff --git a/sqle/model/task.go b/sqle/model/task.go index d72fa7af87..b682982e04 100644 --- a/sqle/model/task.go +++ b/sqle/model/task.go @@ -388,7 +388,7 @@ func (s *Storage) UpdateTaskStatusById(taskId uint, status string) error { } func updateTaskStatusById(tx *gorm.DB, taskId uint, status string) error { - return tx.Model(&Task{}).Where("id = ?", taskId).Updates(map[string]string{ + return tx.Model(&Task{}).Where("id = ?", taskId).Updates(map[string]interface{}{ "status": status, }).Error }