summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/release.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/release.go')
-rw-r--r--routers/api/v1/repo/release.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/release.go b/routers/api/v1/repo/release.go
index ade82f24cb..752b5c76e0 100644
--- a/routers/api/v1/repo/release.go
+++ b/routers/api/v1/repo/release.go
@@ -194,8 +194,8 @@ func CreateRelease(ctx *context.APIContext, form api.CreateReleaseOption) {
rel.Repo = ctx.Repo.Repository
rel.Publisher = ctx.User
- if err = releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil); err != nil {
- ctx.ServerError("UpdateRelease", err)
+ if err = releaseservice.UpdateReleaseOrCreatReleaseFromTag(ctx.User, ctx.Repo.GitRepo, rel, nil, true); err != nil {
+ ctx.ServerError("UpdateReleaseOrCreatReleaseFromTag", err)
return
}
}
@@ -266,8 +266,8 @@ func EditRelease(ctx *context.APIContext, form api.EditReleaseOption) {
if form.IsPrerelease != nil {
rel.IsPrerelease = *form.IsPrerelease
}
- if err := releaseservice.UpdateRelease(ctx.User, ctx.Repo.GitRepo, rel, nil); err != nil {
- ctx.Error(http.StatusInternalServerError, "UpdateRelease", err)
+ if err := releaseservice.UpdateReleaseOrCreatReleaseFromTag(ctx.User, ctx.Repo.GitRepo, rel, nil, false); err != nil {
+ ctx.Error(http.StatusInternalServerError, "UpdateReleaseOrCreatReleaseFromTag", err)
return
}