Browse Source

fix bug with removing deadlines if startTime is set.

main
Gisle Aune 3 years ago
parent
commit
8d6421ea71
  1. 4
      api/project.go

4
api/project.go

@ -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)

Loading…
Cancel
Save