1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

improvement some release related code (#19867)

This commit is contained in:
Lunny Xiao
2022-06-03 14:13:58 +08:00
committed by GitHub
parent 0c759fd4de
commit e09fb30d34
7 changed files with 35 additions and 52 deletions

View File

@@ -98,7 +98,7 @@ func ListReleaseAttachments(ctx *context.APIContext) {
// "$ref": "#/responses/AttachmentList"
releaseID := ctx.ParamsInt64(":id")
release, err := models.GetReleaseByID(releaseID)
release, err := models.GetReleaseByID(ctx, releaseID)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetReleaseByID", err)
return
@@ -164,7 +164,7 @@ func CreateReleaseAttachment(ctx *context.APIContext) {
// Check if release exists an load release
releaseID := ctx.ParamsInt64(":id")
release, err := models.GetReleaseByID(releaseID)
release, err := models.GetReleaseByID(ctx, releaseID)
if err != nil {
ctx.Error(http.StatusInternalServerError, "GetReleaseByID", err)
return