Skip to content

Commit

Permalink
Update struct
Browse files Browse the repository at this point in the history
  • Loading branch information
jolheiser committed Jan 31, 2020
1 parent 6300537 commit 791fa1a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions routers/api/v1/admin/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func parseLoginSource(ctx *context.APIContext, u *models.User, sourceID int64, l
}

// CreateUser create a user
func CreateUser(ctx *context.APIContext, form api.CreateUserOption) {
func CreateUser(ctx *context.APIContext, form api.CreateUserOptions) {
// swagger:operation POST /admin/users admin adminCreateUser
// ---
// summary: Create a user
Expand All @@ -53,7 +53,7 @@ func CreateUser(ctx *context.APIContext, form api.CreateUserOption) {
// - name: body
// in: body
// schema:
// "$ref": "#/definitions/CreateUserOption"
// "$ref": "#/definitions/CreateUserOptions"
// responses:
// "201":
// "$ref": "#/responses/User"
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/orgs", admin.GetAllOrgs)
m.Group("/users", func() {
m.Get("", admin.GetAllUsers)
m.Post("", bind(api.CreateUserOption{}), admin.CreateUser)
m.Post("", bind(api.CreateUserOptions{}), admin.CreateUser)
m.Group("/:username", func() {
m.Combo("").Patch(bind(api.EditUserOption{}), admin.EditUser).
Delete(admin.DeleteUser)
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/swagger/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type swaggerParameterBodies struct {
AddTimeOption api.AddTimeOption

// in:body
CreateUserOption api.CreateUserOption
CreateUserOption api.CreateUserOptions

// in:body
EditUserOption api.EditUserOption
Expand Down
4 changes: 2 additions & 2 deletions sdk/admin_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

package sdk

// CreateUserOption create user options
type CreateUserOption struct {
// CreateUserOptions create user options
type CreateUserOptions struct {
SourceID int64 `json:"source_id"`
LoginName string `json:"login_name"`
// required: true
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/jolheiser/gitea/sdk/admin_user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 791fa1a

Please sign in to comment.