aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/org/team.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/org/team.go')
-rw-r--r--routers/api/v1/org/team.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go
index 72387dcbf7..c749751ac4 100644
--- a/routers/api/v1/org/team.go
+++ b/routers/api/v1/org/team.go
@@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/modules/convert"
"code.gitea.io/gitea/modules/log"
api "code.gitea.io/gitea/modules/structs"
+ "code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/routers/api/v1/user"
"code.gitea.io/gitea/routers/api/v1/utils"
)
@@ -131,7 +132,7 @@ func GetTeam(ctx *context.APIContext) {
}
// CreateTeam api for create a team
-func CreateTeam(ctx *context.APIContext, form api.CreateTeamOption) {
+func CreateTeam(ctx *context.APIContext) {
// swagger:operation POST /orgs/{org}/teams organization orgCreateTeam
// ---
// summary: Create a team
@@ -154,7 +155,7 @@ func CreateTeam(ctx *context.APIContext, form api.CreateTeamOption) {
// "$ref": "#/responses/Team"
// "422":
// "$ref": "#/responses/validationError"
-
+ form := web.GetForm(ctx).(*api.CreateTeamOption)
team := &models.Team{
OrgID: ctx.Org.Organization.ID,
Name: form.Name,
@@ -190,7 +191,7 @@ func CreateTeam(ctx *context.APIContext, form api.CreateTeamOption) {
}
// EditTeam api for edit a team
-func EditTeam(ctx *context.APIContext, form api.EditTeamOption) {
+func EditTeam(ctx *context.APIContext) {
// swagger:operation PATCH /teams/{id} organization orgEditTeam
// ---
// summary: Edit a team
@@ -212,6 +213,8 @@ func EditTeam(ctx *context.APIContext, form api.EditTeamOption) {
// "200":
// "$ref": "#/responses/Team"
+ form := web.GetForm(ctx).(*api.EditTeamOption)
+
team := ctx.Org.Team
if err := team.GetUnits(); err != nil {
ctx.InternalServerError(err)