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

Function UpdateLabel

internal/route/repo/issue.go:1058–1072  ·  view source on GitHub ↗
(c *context.Context, f form.CreateLabel)

Source from the content-addressed store, hash-verified

1056}
1057
1058func UpdateLabel(c *context.Context, f form.CreateLabel) {
1059 l, err := database.GetLabelOfRepoByID(c.Repo.Repository.ID, f.ID)
1060 if err != nil {
1061 c.NotFoundOrError(err, "get label of repository by ID")
1062 return
1063 }
1064
1065 l.Name = f.Title
1066 l.Color = f.Color
1067 if err := database.UpdateLabel(l); err != nil {
1068 c.Error(err, "update label")
1069 return
1070 }
1071 c.RawRedirect(c.Repo.MakeURL("labels"))
1072}
1073
1074func DeleteLabel(c *context.Context) {
1075 if err := database.DeleteLabel(c.Repo.Repository.ID, c.QueryInt64("id")); err != nil {

Callers

nothing calls this directly

Calls 6

GetLabelOfRepoByIDFunction · 0.92
UpdateLabelFunction · 0.92
RawRedirectMethod · 0.80
MakeURLMethod · 0.80
NotFoundOrErrorMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected