|
|
@ -86,24 +86,6 @@ func Task(g *gin.RouterGroup, db database.Database) { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
|
|
|
|
if update.ItemID != nil && *update.ItemID != task.ItemID { |
|
|
|
_, err := l.FindItem(c.Request.Context(), *update.ItemID) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
|
|
|
|
logs, err := l.ListLogs(c.Request.Context(), models.LogFilter{ |
|
|
|
TaskIDs: []string{task.ID}, |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
|
|
|
|
if len(logs) > 0 { |
|
|
|
return nil, slerrors.Forbidden("You cannot change the item if the task has logs.") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if update.ProjectID != nil && *update.ProjectID != task.ProjectID { |
|
|
|
project, err := l.FindProject(c.Request.Context(), *update.ProjectID) |
|
|
|
if err != nil { |
|
|
|