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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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