|
|
@ -98,8 +98,10 @@ func Project(g *gin.RouterGroup, db database.Database) { |
|
|
|
|
|
|
|
project.Update(update) |
|
|
|
|
|
|
|
if project.StartTime != nil && (project.EndTime == nil || !project.StartTime.Before(*project.EndTime)) { |
|
|
|
if project.EndTime != nil && project.StartTime != nil && (project.EndTime == nil || !project.StartTime.Before(*project.EndTime)) { |
|
|
|
return nil, slerrors.BadRequest("Project start time must be before end time.") |
|
|
|
} else { |
|
|
|
project.StartTime = nil |
|
|
|
} |
|
|
|
|
|
|
|
err = db.Projects().Update(c.Request.Context(), project.Project) |
|
|
|