From 80888b80d6a1e59510347b7797dd07ab85e3afdb Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 9 Apr 2024 16:00:28 +0200 Subject: [PATCH] Fix imports --- routers/api/v1/activitypub/repository.go | 2 +- routers/api/v1/activitypub/response.go | 2 +- services/context/repository.go | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index 5c2f0b2f67..68e4a51a83 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -9,10 +9,10 @@ import ( "strings" forgefed_model "code.gitea.io/gitea/models/forgefed" - "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/web" + "code.gitea.io/gitea/services/context" "code.gitea.io/gitea/services/federation" ap "github.com/go-ap/activitypub" diff --git a/routers/api/v1/activitypub/response.go b/routers/api/v1/activitypub/response.go index 882e2bbe6c..1eca027f30 100644 --- a/routers/api/v1/activitypub/response.go +++ b/routers/api/v1/activitypub/response.go @@ -8,8 +8,8 @@ import ( "code.gitea.io/gitea/models/forgefed" "code.gitea.io/gitea/modules/activitypub" - "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/services/context" ap "github.com/go-ap/activitypub" "github.com/go-ap/jsonld" diff --git a/services/context/repository.go b/services/context/repository.go index a3c0b6b30d..c49d5bb4e3 100644 --- a/services/context/repository.go +++ b/services/context/repository.go @@ -7,17 +7,16 @@ import ( "net/http" repo_model "code.gitea.io/gitea/models/repo" - "code.gitea.io/gitea/modules/context" ) // RepositoryIDAssignmentAPI returns a middleware to handle context-repo assignment for api routes -func RepositoryIDAssignmentAPI() func(ctx *context.APIContext) { - return func(ctx *context.APIContext) { +func RepositoryIDAssignmentAPI() func(ctx *APIContext) { + return func(ctx *APIContext) { // TODO: enough validation for security? repositoryID := ctx.ParamsInt64(":repository-id") var err error - repository := new(context.Repository) + repository := new(Repository) repository.Repository, err = repo_model.GetRepositoryByID(ctx, repositoryID) if err != nil { ctx.Error(http.StatusInternalServerError, "GetRepositoryByID", err)