Extract actions on deletereleasebyid from models to release service (#8219)
* extract actions on deletereleasebyid from models to release service * fix tests
This commit is contained in:
parent
ecd4bfd284
commit
3249c0ccba
6 changed files with 81 additions and 70 deletions
|
@ -316,7 +316,7 @@ func DeleteRelease(ctx *context.APIContext) {
|
|||
ctx.NotFound()
|
||||
return
|
||||
}
|
||||
if err := models.DeleteReleaseByID(id, ctx.User, false); err != nil {
|
||||
if err := releaseservice.DeleteReleaseByID(id, ctx.User, false); err != nil {
|
||||
ctx.Error(500, "DeleteReleaseByID", err)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ func EditReleasePost(ctx *context.Context, form auth.EditReleaseForm) {
|
|||
|
||||
// DeleteRelease delete a release
|
||||
func DeleteRelease(ctx *context.Context) {
|
||||
if err := models.DeleteReleaseByID(ctx.QueryInt64("id"), ctx.User, true); err != nil {
|
||||
if err := releaseservice.DeleteReleaseByID(ctx.QueryInt64("id"), ctx.User, true); err != nil {
|
||||
ctx.Flash.Error("DeleteReleaseByID: " + err.Error())
|
||||
} else {
|
||||
ctx.Flash.Success(ctx.Tr("repo.release.deletion_success"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue