HandleCommentDelete is an HTTP handler for deleting a pull request comment.
(pullreqCtrl *pullreq.Controller)
| 24 | |
| 25 | // HandleCommentDelete is an HTTP handler for deleting a pull request comment. |
| 26 | func HandleCommentDelete(pullreqCtrl *pullreq.Controller) http.HandlerFunc { |
| 27 | return func(w http.ResponseWriter, r *http.Request) { |
| 28 | ctx := r.Context() |
| 29 | session, _ := request.AuthSessionFrom(ctx) |
| 30 | |
| 31 | repoRef, err := request.GetRepoRefFromPath(r) |
| 32 | if err != nil { |
| 33 | render.TranslatedUserError(ctx, w, err) |
| 34 | return |
| 35 | } |
| 36 | |
| 37 | pullreqNumber, err := request.GetPullReqNumberFromPath(r) |
| 38 | if err != nil { |
| 39 | render.TranslatedUserError(ctx, w, err) |
| 40 | return |
| 41 | } |
| 42 | |
| 43 | commentID, err := request.GetPullReqCommentIDPath(r) |
| 44 | if err != nil { |
| 45 | render.TranslatedUserError(ctx, w, err) |
| 46 | return |
| 47 | } |
| 48 | |
| 49 | err = pullreqCtrl.CommentDelete(ctx, session, repoRef, pullreqNumber, commentID) |
| 50 | if err != nil { |
| 51 | render.TranslatedUserError(ctx, w, err) |
| 52 | return |
| 53 | } |
| 54 | |
| 55 | render.DeleteSuccessful(w) |
| 56 | } |
| 57 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…