From 8567cba0d978e6ab68c337c0a80244704a15718a Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 23 Mar 2021 00:09:51 +0800 Subject: 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 --- routers/api/v1/repo/release.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'routers/api') 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 } -- cgit v1.2.3