MCPcopy Create free account
hub / github.com/gogs/gogs / UpdateIssueContent

Function UpdateIssueContent

internal/route/repo/issue.go:721–741  ·  view source on GitHub ↗
(c *context.Context)

Source from the content-addressed store, hash-verified

719}
720
721func UpdateIssueContent(c *context.Context) {
722 issue := getActionIssue(c)
723 if c.Written() {
724 return
725 }
726
727 if !c.IsLogged || (c.User.ID != issue.PosterID && !c.Repo.IsWriter()) {
728 c.Status(http.StatusForbidden)
729 return
730 }
731
732 content := c.Query("content")
733 if err := issue.ChangeContent(c.User, content); err != nil {
734 c.Error(err, "change content")
735 return
736 }
737
738 c.JSONSuccess(map[string]string{
739 "content": string(markup.Markdown(issue.Content, c.Query("context"), c.Repo.Repository.ComposeMetas())),
740 })
741}
742
743func UpdateIssueLabel(c *context.Context) {
744 issue := getActionIssue(c)

Callers

nothing calls this directly

Calls 8

MarkdownFunction · 0.92
getActionIssueFunction · 0.85
stringFunction · 0.85
IsWriterMethod · 0.80
ChangeContentMethod · 0.80
JSONSuccessMethod · 0.80
ComposeMetasMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected