mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 09:13:53 +01:00
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"
|
"strings"
|
||||||
|
|
||||||
forgefed_model "code.gitea.io/gitea/models/forgefed"
|
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/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/web"
|
"code.gitea.io/gitea/modules/web"
|
||||||
|
"code.gitea.io/gitea/services/context"
|
||||||
"code.gitea.io/gitea/services/federation"
|
"code.gitea.io/gitea/services/federation"
|
||||||
|
|
||||||
ap "github.com/go-ap/activitypub"
|
ap "github.com/go-ap/activitypub"
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
|
|
||||||
"code.gitea.io/gitea/models/forgefed"
|
"code.gitea.io/gitea/models/forgefed"
|
||||||
"code.gitea.io/gitea/modules/activitypub"
|
"code.gitea.io/gitea/modules/activitypub"
|
||||||
"code.gitea.io/gitea/modules/context"
|
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
|
"code.gitea.io/gitea/services/context"
|
||||||
|
|
||||||
ap "github.com/go-ap/activitypub"
|
ap "github.com/go-ap/activitypub"
|
||||||
"github.com/go-ap/jsonld"
|
"github.com/go-ap/jsonld"
|
||||||
|
|
|
@ -7,17 +7,16 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
repo_model "code.gitea.io/gitea/models/repo"
|
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
|
// RepositoryIDAssignmentAPI returns a middleware to handle context-repo assignment for api routes
|
||||||
func RepositoryIDAssignmentAPI() func(ctx *context.APIContext) {
|
func RepositoryIDAssignmentAPI() func(ctx *APIContext) {
|
||||||
return func(ctx *context.APIContext) {
|
return func(ctx *APIContext) {
|
||||||
// TODO: enough validation for security?
|
// TODO: enough validation for security?
|
||||||
repositoryID := ctx.ParamsInt64(":repository-id")
|
repositoryID := ctx.ParamsInt64(":repository-id")
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
repository := new(context.Repository)
|
repository := new(Repository)
|
||||||
repository.Repository, err = repo_model.GetRepositoryByID(ctx, repositoryID)
|
repository.Repository, err = repo_model.GetRepositoryByID(ctx, repositoryID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, "GetRepositoryByID", err)
|
ctx.Error(http.StatusInternalServerError, "GetRepositoryByID", err)
|
||||||
|
|
Loading…
Reference in a new issue