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
-66
@@ -1144,52 +1144,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/users/{username}/convert-type": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"admin"
|
||||
],
|
||||
"summary": "Convert an account between the user and bot types",
|
||||
"operationId": "adminConvertUserType",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "username of the user to convert",
|
||||
"name": "username",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/ConvertUserTypeOption"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/responses/error"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/responses/forbidden"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/admin/users/{username}/keys": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
@@ -26790,25 +26744,6 @@
|
||||
},
|
||||
"x-go-package": "gitea.dev/modules/structs"
|
||||
},
|
||||
"ConvertUserTypeOption": {
|
||||
"description": "ConvertUserTypeOption options when converting a user between individual and bot",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"user_type"
|
||||
],
|
||||
"properties": {
|
||||
"user_type": {
|
||||
"description": "The target user type",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"User",
|
||||
"Bot"
|
||||
],
|
||||
"x-go-name": "UserType"
|
||||
}
|
||||
},
|
||||
"x-go-package": "gitea.dev/modules/structs"
|
||||
},
|
||||
"CreateAccessTokenOption": {
|
||||
"description": "CreateAccessTokenOption options when create access token",
|
||||
"type": "object",
|
||||
@@ -29457,6 +29392,17 @@
|
||||
"format": "int64",
|
||||
"x-go-name": "SourceID"
|
||||
},
|
||||
"type": {
|
||||
"description": "The user type",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"User",
|
||||
"Organization",
|
||||
"Bot"
|
||||
],
|
||||
"x-go-enum-desc": "User UserTypeStringUser\nOrganization UserTypeStringOrganization\nBot UserTypeStringBot",
|
||||
"x-go-name": "Type"
|
||||
},
|
||||
"visibility": {
|
||||
"description": "User visibility level: public, limited, or private",
|
||||
"type": "string",
|
||||
@@ -33820,7 +33766,7 @@
|
||||
"x-go-name": "StarredRepos"
|
||||
},
|
||||
"type": {
|
||||
"description": "the account type",
|
||||
"description": "the user type",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"User",
|
||||
|
||||
Reference in New Issue
Block a user