(pullreqCtrl *pullreq.Controller)
| 23 | ) |
| 24 | |
| 25 | func HandleCodeOwner(pullreqCtrl *pullreq.Controller) http.HandlerFunc { |
| 26 | return func(w http.ResponseWriter, r *http.Request) { |
| 27 | ctx := r.Context() |
| 28 | session, _ := request.AuthSessionFrom(ctx) |
| 29 | |
| 30 | repoRef, err := request.GetRepoRefFromPath(r) |
| 31 | if err != nil { |
| 32 | render.TranslatedUserError(ctx, w, err) |
| 33 | return |
| 34 | } |
| 35 | |
| 36 | pullreqNumber, err := request.GetPullReqNumberFromPath(r) |
| 37 | if err != nil { |
| 38 | render.TranslatedUserError(ctx, w, err) |
| 39 | return |
| 40 | } |
| 41 | |
| 42 | owners, err := pullreqCtrl.CodeOwners(ctx, session, repoRef, pullreqNumber) |
| 43 | if err != nil { |
| 44 | render.TranslatedUserError(ctx, w, err) |
| 45 | return |
| 46 | } |
| 47 | |
| 48 | render.JSON(w, http.StatusOK, owners) |
| 49 | } |
| 50 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…