(c *context.Context)
| 692 | } |
| 693 | |
| 694 | func 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 | |
| 721 | func UpdateIssueContent(c *context.Context) { |
| 722 | issue := getActionIssue(c) |
nothing calls this directly
no test coverage detected