mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-21 04:03:38 +09:00
refactor(api): convert bot accounts through the admin user edit endpoint (#39355)
Follow-up to https://github.com/go-gitea/gitea/pull/38966. Replaces the unreleased `POST /admin/users/{username}/convert-type` endpoint with a `type` field on `PATCH /admin/users/{username}`.
This commit is contained in:
@@ -76,13 +76,6 @@ type EditUserOption struct {
|
||||
Restricted *bool `json:"restricted"`
|
||||
// User visibility level: public, limited, or private
|
||||
Visibility VisibilityString `json:"visibility" binding:"In(,public,limited,private)"`
|
||||
}
|
||||
|
||||
// ConvertUserTypeOption options when converting a user between individual and bot
|
||||
type ConvertUserTypeOption struct {
|
||||
// The target user type
|
||||
//
|
||||
// required: true
|
||||
// enum: ["User","Bot"]
|
||||
UserType UserTypeString `json:"user_type" binding:"Required;In(User,Bot)"`
|
||||
// The user type
|
||||
Type UserTypeString `json:"type" binding:"In(User,Organization,Bot)"`
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ type User struct {
|
||||
ID int64 `json:"id"`
|
||||
// login of the user, same as `username`
|
||||
UserName string `json:"login"`
|
||||
// the account type
|
||||
// the user type
|
||||
Type UserTypeString `json:"type"`
|
||||
// identifier of the user, provided by the external authenticator (if configured)
|
||||
LoginName string `json:"login_name"`
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
package structs
|
||||
|
||||
// UserTypeString defines the account type as rendered in API responses, webhook payloads and
|
||||
// UserTypeString defines the user type as rendered in API responses, webhook payloads and
|
||||
// the resulting GitHub Actions event context, where workflows read it as `github.event.sender.type`.
|
||||
// The values are capitalized to stay compatible with GitHub, unlike VisibilityString and the other
|
||||
// lowercase API enums. The DB representation is user.UserType (int).
|
||||
|
||||
Reference in New Issue
Block a user