Inclusion of rename organization api (#33303)
This adds an endpoint (`/orgs/{org}/rename`) to rename organizations. I've modeled the endpoint using the rename user endpoint -- `/admin/users/{username}/rename` -- as base. It is the 1st time I wrote a new API endpoint (I've tried to follow the rename users endpoint code while writing it). So feel free to ping me if there is something wrong or missing. Resolves #32995 --------- Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
5b83203f37
commit
040c830dec
7 changed files with 240 additions and 141 deletions
56
templates/swagger/v1_json.tmpl
generated
56
templates/swagger/v1_json.tmpl
generated
|
@ -2991,6 +2991,46 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/orgs/{org}/rename": {
|
||||
"post": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"organization"
|
||||
],
|
||||
"summary": "Rename an organization",
|
||||
"operationId": "renameOrg",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "existing org name",
|
||||
"name": "org",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/RenameOrgOption"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/responses/forbidden"
|
||||
},
|
||||
"422": {
|
||||
"$ref": "#/responses/validationError"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/orgs/{org}/repos": {
|
||||
"get": {
|
||||
"produces": [
|
||||
|
@ -24207,6 +24247,22 @@
|
|||
},
|
||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||
},
|
||||
"RenameOrgOption": {
|
||||
"description": "RenameOrgOption options when renaming an organization",
|
||||
"type": "object",
|
||||
"required": [
|
||||
"new_name"
|
||||
],
|
||||
"properties": {
|
||||
"new_name": {
|
||||
"description": "New username for this org. This name cannot be in use yet by any other user.",
|
||||
"type": "string",
|
||||
"uniqueItems": true,
|
||||
"x-go-name": "NewName"
|
||||
}
|
||||
},
|
||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||
},
|
||||
"RenameUserOption": {
|
||||
"description": "RenameUserOption options when renaming a user",
|
||||
"type": "object",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue