mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-15 13:13:59 +09:00
golint fixed for routers (#208)
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
)
|
||||
|
||||
// GetRepositoryByParams api for getting repository by orgnizition ID and repo name
|
||||
func GetRepositoryByParams(ctx *context.APIContext) *models.Repository {
|
||||
repo, err := models.GetRepositoryByName(ctx.Org.Team.OrgID, ctx.Params(":reponame"))
|
||||
if err != nil {
|
||||
@ -22,6 +23,7 @@ func GetRepositoryByParams(ctx *context.APIContext) *models.Repository {
|
||||
return repo
|
||||
}
|
||||
|
||||
// AddTeamRepository api for adding a repository to a team
|
||||
func AddTeamRepository(ctx *context.APIContext) {
|
||||
repo := GetRepositoryByParams(ctx)
|
||||
if ctx.Written() {
|
||||
@ -35,6 +37,7 @@ func AddTeamRepository(ctx *context.APIContext) {
|
||||
ctx.Status(204)
|
||||
}
|
||||
|
||||
// RemoveTeamRepository api for removing a repository from a team
|
||||
func RemoveTeamRepository(ctx *context.APIContext) {
|
||||
repo := GetRepositoryByParams(ctx)
|
||||
if ctx.Written() {
|
||||
|
Reference in New Issue
Block a user