Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-25 11:16:11 +01:00

Fix imports

This commit is contained in:
erik 2024-04-09 16:00:28 +02:00
parent af0d0f7745
commit 80888b80d6
3 changed files with 5 additions and 6 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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)