@ -47,7 +47,7 @@ func ListTeams(ctx *context.APIContext) {
// "200":
// "200":
// "$ref": "#/responses/TeamList"
// "$ref": "#/responses/TeamList"
teams , count , err := models . SearchTeam ( & models . SearchTeamOptions {
teams , count , err := models . SearchOrg Teams ( & models . SearchOrg TeamOptions {
ListOptions : utils . GetListOptions ( ctx ) ,
ListOptions : utils . GetListOptions ( ctx ) ,
OrgID : ctx . Org . Organization . ID ,
OrgID : ctx . Org . Organization . ID ,
} )
} )
@ -90,7 +90,7 @@ func ListUserTeams(ctx *context.APIContext) {
// "200":
// "200":
// "$ref": "#/responses/TeamList"
// "$ref": "#/responses/TeamList"
teams , count , err := models . SearchTeam ( & models . Search TeamOptions{
teams , count , err := models . GetUserTeams ( & models . GetUser TeamOptions{
ListOptions : utils . GetListOptions ( ctx ) ,
ListOptions : utils . GetListOptions ( ctx ) ,
UserID : ctx . User . ID ,
UserID : ctx . User . ID ,
} )
} )
@ -533,7 +533,7 @@ func GetTeamRepos(ctx *context.APIContext) {
// "$ref": "#/responses/RepositoryList"
// "$ref": "#/responses/RepositoryList"
team := ctx . Org . Team
team := ctx . Org . Team
if err := team . GetRepositories ( & models . SearchTeamOptions {
if err := team . GetRepositories ( & models . SearchOrg TeamOptions {
ListOptions : utils . GetListOptions ( ctx ) ,
ListOptions : utils . GetListOptions ( ctx ) ,
} ) ; err != nil {
} ) ; err != nil {
ctx . Error ( http . StatusInternalServerError , "GetTeamRepos" , err )
ctx . Error ( http . StatusInternalServerError , "GetTeamRepos" , err )
@ -707,15 +707,14 @@ func SearchTeam(ctx *context.APIContext) {
listOptions := utils . GetListOptions ( ctx )
listOptions := utils . GetListOptions ( ctx )
opts := & models . SearchTeamOptions {
opts := & models . SearchOrgTeamOptions {
UserID : ctx . User . ID ,
Keyword : ctx . FormTrim ( "q" ) ,
Keyword : ctx . FormTrim ( "q" ) ,
OrgID : ctx . Org . Organization . ID ,
OrgID : ctx . Org . Organization . ID ,
IncludeDesc : ctx . FormString ( "include_desc" ) == "" || ctx . FormBool ( "include_desc" ) ,
IncludeDesc : ctx . FormString ( "include_desc" ) == "" || ctx . FormBool ( "include_desc" ) ,
ListOptions : listOptions ,
ListOptions : listOptions ,
}
}
teams , maxResults , err := models . SearchTeam ( opts )
teams , maxResults , err := models . SearchOrg Teams ( opts )
if err != nil {
if err != nil {
log . Error ( "SearchTeam failed: %v" , err )
log . Error ( "SearchTeam failed: %v" , err )
ctx . JSON ( http . StatusInternalServerError , map [ string ] interface { } {
ctx . JSON ( http . StatusInternalServerError , map [ string ] interface { } {