aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/release_attachment.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-08-25 10:31:57 +0800
committerGitHub <noreply@github.com>2022-08-25 10:31:57 +0800
commit1d8543e7db58d7c4973758e47f005c4d8bd7d7a3 (patch)
treeb60c99e2dfd69ccb998f8a0829d98d7cadcf0d6b /routers/api/v1/repo/release_attachment.go
parent4a4bfafa238bf48851f8c11fa3701bd42b912475 (diff)
downloadgitea-1d8543e7db58d7c4973758e47f005c4d8bd7d7a3.tar.gz
gitea-1d8543e7db58d7c4973758e47f005c4d8bd7d7a3.zip
Move some files into models' sub packages (#20262)
* Move some files into models' sub packages * Move functions * merge main branch * Fix check * fix check * Fix some tests * Fix lint * Fix lint * Revert lint changes * Fix error comments * Fix lint Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/api/v1/repo/release_attachment.go')
-rw-r--r--routers/api/v1/repo/release_attachment.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/routers/api/v1/repo/release_attachment.go b/routers/api/v1/repo/release_attachment.go
index 7b63af34c8..a469877c13 100644
--- a/routers/api/v1/repo/release_attachment.go
+++ b/routers/api/v1/repo/release_attachment.go
@@ -7,7 +7,6 @@ package repo
import (
"net/http"
- "code.gitea.io/gitea/models"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/convert"
@@ -102,9 +101,9 @@ func ListReleaseAttachments(ctx *context.APIContext) {
// "$ref": "#/responses/AttachmentList"
releaseID := ctx.ParamsInt64(":id")
- release, err := models.GetReleaseByID(ctx, releaseID)
+ release, err := repo_model.GetReleaseByID(ctx, releaseID)
if err != nil {
- if models.IsErrReleaseNotExist(err) {
+ if repo_model.IsErrReleaseNotExist(err) {
ctx.NotFound()
return
}
@@ -172,9 +171,9 @@ func CreateReleaseAttachment(ctx *context.APIContext) {
// Check if release exists an load release
releaseID := ctx.ParamsInt64(":id")
- release, err := models.GetReleaseByID(ctx, releaseID)
+ release, err := repo_model.GetReleaseByID(ctx, releaseID)
if err != nil {
- if models.IsErrReleaseNotExist(err) {
+ if repo_model.IsErrReleaseNotExist(err) {
ctx.NotFound()
return
}