summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/org/org.go
diff options
context:
space:
mode:
authorShashvat Kedia <sk261@snu.edu.in>2018-12-27 21:06:58 +0530
committerJonas Franz <info@jonasfranz.software>2018-12-27 16:36:58 +0100
commit6e20b504b1d5f63b1835f2826d6cbaf2064f479d (patch)
tree789a1a010033a50e86695dd55a3e3931d0b9a98d /routers/api/v1/org/org.go
parent21357a4ae04068a7ebe5ee5bc800ef36e11fd614 (diff)
downloadgitea-6e20b504b1d5f63b1835f2826d6cbaf2064f479d.tar.gz
gitea-6e20b504b1d5f63b1835f2826d6cbaf2064f479d.zip
Delete organization endpoint added (#5601)
* Delete organization endpoint added * Parameters added in comment * Typo fix * Newline character removed
Diffstat (limited to 'routers/api/v1/org/org.go')
-rw-r--r--routers/api/v1/org/org.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go
index 217b38683e..59351e20d1 100644
--- a/routers/api/v1/org/org.go
+++ b/routers/api/v1/org/org.go
@@ -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)
+}