diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-03-23 00:09:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 00:09:51 +0800 |
commit | 8567cba0d978e6ab68c337c0a80244704a15718a (patch) | |
tree | db8794db6a32057adadda9460bf5923aee9ae89f /routers/api | |
parent | 1a03fa7a4f353eb2f965cdcac39f630c281eca1e (diff) | |
download | gitea-8567cba0d978e6ab68c337c0a80244704a15718a.tar.gz gitea-8567cba0d978e6ab68c337c0a80244704a15718a.zip |
Implement delete release attachments and update release attachments' name (#14130)
* Implement delete release attachment
* Add attachments on release edit page
* Fix bug
* Finish del release attachments
* Fix frontend lint
* Fix tests
* Support edit release attachments
* Added tests
* Remove the unnecessary parameter isCreate from UpdateReleaseOrCreatReleaseFromTag
* Rename UpdateReleaseOrCreatReleaseFromTag to UpdateRelease
* Fix middle align
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/repo/release.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go index e9eb4e0f9e..327a2d790b 100644 --- a/routers/api/v1/repo/release.go +++ b/routers/api/v1/repo/release.go @@ -202,8 +202,8 @@ func CreateRelease(ctx *context.APIContext) { rel.Repo = ctx.Repo.Repository rel.Publisher = ctx.User - if err = releaseservice.UpdateReleaseOrCreatReleaseFromTag(ctx.User, ctx.Repo.GitRepo, rel, nil, true); err != nil { - ctx.Error(http.StatusInternalServerError, "UpdateReleaseOrCreatReleaseFromTag", err) + if err = releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil, nil, nil); err != nil { + ctx.Error(http.StatusInternalServerError, "UpdateRelease", err) return } } @@ -277,8 +277,8 @@ func EditRelease(ctx *context.APIContext) { if form.IsPrerelease != nil { rel.IsPrerelease = *form.IsPrerelease } - if err := releaseservice.UpdateReleaseOrCreatReleaseFromTag(ctx.User, ctx.Repo.GitRepo, rel, nil, false); err != nil { - ctx.Error(http.StatusInternalServerError, "UpdateReleaseOrCreatReleaseFromTag", err) + if err := releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil, nil, nil); err != nil { + ctx.Error(http.StatusInternalServerError, "UpdateRelease", err) return } |