mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Delete organization endpoint added (#5601)
* Delete organization endpoint added * Parameters added in comment * Typo fix * Newline character removed
This commit is contained in:
parent
21357a4ae0
commit
6e20b504b1
3 changed files with 49 additions and 1 deletions
|
@ -166,3 +166,26 @@ func Edit(ctx *context.APIContext, form api.EditOrgOption) {
|
|||
|
||||
ctx.JSON(200, convert.ToOrganization(org))
|
||||
}
|
||||
|
||||
//Delete an organization
|
||||
func Delete(ctx *context.APIContext) {
|
||||
// swagger:operation DELETE /orgs/{org} organization orgDelete
|
||||
// ---
|
||||
// summary: Delete an organization
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: org
|
||||
// in: path
|
||||
// description: organization that is to be deleted
|
||||
// type: string
|
||||
// required: true
|
||||
// responses:
|
||||
// "204":
|
||||
// "$ref": "#/responses/empty"
|
||||
if err := models.DeleteOrganization(ctx.Org.Organization); err != nil {
|
||||
ctx.Error(500, "DeleteOrganization", err)
|
||||
return
|
||||
}
|
||||
ctx.Status(204)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue