fix bug with removing deadlines if startTime is set.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
+3
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user