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:
@@ -12,7 +12,7 @@ import (
|
||||
"gitea.dev/modules/util"
|
||||
)
|
||||
|
||||
func userTypeToString(t user_model.UserType) api.UserTypeString {
|
||||
func UserTypeToString(t user_model.UserType) api.UserTypeString {
|
||||
switch t {
|
||||
case user_model.UserTypeOrganization, user_model.UserTypeOrganizationReserved:
|
||||
return api.UserTypeStringOrganization
|
||||
@@ -74,7 +74,7 @@ func toUser(ctx context.Context, user *user_model.User, signed, authed bool) *ap
|
||||
result := &api.User{
|
||||
ID: user.ID,
|
||||
UserName: user.Name,
|
||||
Type: userTypeToString(user.Type),
|
||||
Type: UserTypeToString(user.Type),
|
||||
FullName: user.FullName,
|
||||
Email: user.GetPlaceholderEmail(),
|
||||
AvatarURL: user.AvatarLink(ctx),
|
||||
|
||||
Reference in New Issue
Block a user