allow moving tasks between projects.
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-02-14 17:44:07 +01:00
parent 73855ffdd1
commit 8313a27251
6 changed files with 99 additions and 3 deletions
+9
View File
@@ -104,6 +104,15 @@ func Task(g *gin.RouterGroup, db database.Database) {
}
}
if update.ProjectID != nil && *update.ProjectID != task.ProjectID {
project, err := l.FindProject(c.Request.Context(), *update.ProjectID)
if err != nil {
return nil, slerrors.NotFound("Destination project")
}
task.ProjectID = project.ID
}
task.Update(update)
if task.EndTime != nil && task.EndTime.Before(task.CreatedTime) {
return nil, slerrors.BadRequest("Task end time must be later than it was created.")