Skip to content

Commit

Permalink
enhance: adding a branch field to scheduled builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Claire.Nicholas authored and Claire.Nicholas committed Aug 22, 2023
1 parent 6828ded commit 55e3d0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/schedule/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ func CreateSchedule(c *gin.Context) {
s.SetCreatedAt(time.Now().UTC().Unix())
s.SetUpdatedAt(time.Now().UTC().Unix())
s.SetUpdatedBy(u.GetName())
s.SetBranch(input.GetBranch())

if input.GetBranch() == "" {
s.SetBranch(*r.Branch)
} else {
s.SetBranch(input.GetBranch())
}

// set the active field based off the input provided
if input.Active == nil {
Expand Down

0 comments on commit 55e3d0e

Please sign in to comment.