Skip to content

Commit

Permalink
Add inject query param.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Dec 14, 2023
1 parent 2fa85a7 commit de644bf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions api/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"io/ioutil"
k8serr "k8s.io/apimachinery/pkg/api/errors"
"net/http"
"sort"
"strconv"
"strings"
"time"
"sort"
)

//
Expand Down Expand Up @@ -86,10 +87,13 @@ func (h TaskHandler) Get(ctx *gin.Context) {
}
r := Task{}
r.With(task)
err := r.injectFiles(h.DB(ctx))
if err != nil {
_ = ctx.Error(result.Error)
return
q := ctx.Query("inject")
if b, _ := strconv.ParseBool(q); b {
err := r.injectFiles(h.DB(ctx))
if err != nil {
_ = ctx.Error(result.Error)
return
}
}

h.Respond(ctx, http.StatusOK, r)
Expand Down

0 comments on commit de644bf

Please sign in to comment.