MCPcopy
hub / github.com/harness/harness / HandleCommentDelete

Function HandleCommentDelete

app/api/handler/pullreq/comment_delete.go:26–57  ·  view source on GitHub ↗

HandleCommentDelete is an HTTP handler for deleting a pull request comment.

(pullreqCtrl *pullreq.Controller)

Source from the content-addressed store, hash-verified

24
25// HandleCommentDelete is an HTTP handler for deleting a pull request comment.
26func 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}

Callers

nothing calls this directly

Calls 7

AuthSessionFromFunction · 0.92
GetRepoRefFromPathFunction · 0.92
TranslatedUserErrorFunction · 0.92
GetPullReqNumberFromPathFunction · 0.92
GetPullReqCommentIDPathFunction · 0.92
DeleteSuccessfulFunction · 0.92
CommentDeleteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…