Fix imports
This commit is contained in:
parent
af0d0f7745
commit
80888b80d6
3 changed files with 5 additions and 6 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue