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

Function UpdateIssueTitle

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

Source from the content-addressed store, hash-verified

692}
693
694func UpdateIssueTitle(c *context.Context) {
695 issue := getActionIssue(c)
696 if c.Written() {
697 return
698 }
699
700 if !c.IsLogged || (!issue.IsPoster(c.User.ID) && !c.Repo.IsWriter()) {
701 c.Status(http.StatusForbidden)
702 return
703 }
704
705 title := c.QueryTrim("title")
706 if title == "" {
707 c.Status(http.StatusNoContent)
708 return
709 }
710
711 if err := issue.ChangeTitle(c.User, title); err != nil {
712 c.Error(err, "change title")
713 return
714 }
715
716 c.JSONSuccess(map[string]any{
717 "title": issue.Title,
718 })
719}
720
721func UpdateIssueContent(c *context.Context) {
722 issue := getActionIssue(c)

Callers

nothing calls this directly

Calls 6

getActionIssueFunction · 0.85
IsPosterMethod · 0.80
IsWriterMethod · 0.80
ChangeTitleMethod · 0.80
JSONSuccessMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected