File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -622,7 +622,8 @@ func RegisterRoutes(m *macaron.Macaron) {
622
622
m .Group ("/orgs/:orgname" , func () {
623
623
m .Get ("/repos" , user .ListOrgRepos )
624
624
m .Combo ("" ).Get (org .Get ).
625
- Patch (reqToken (), reqOrgOwnership (), bind (api.EditOrgOption {}), org .Edit )
625
+ Patch (reqToken (), reqOrgOwnership (), bind (api.EditOrgOption {}), org .Edit ).
626
+ Delete (reqToken (), reqOrgOwnership (), org .Delete )
626
627
m .Group ("/members" , func () {
627
628
m .Get ("" , org .ListMembers )
628
629
m .Combo ("/:username" ).Get (org .IsMember ).
Original file line number Diff line number Diff line change @@ -166,3 +166,26 @@ func Edit(ctx *context.APIContext, form api.EditOrgOption) {
166
166
167
167
ctx .JSON (200 , convert .ToOrganization (org ))
168
168
}
169
+
170
+ //Delete an organization
171
+ func Delete (ctx * context.APIContext ) {
172
+ // swagger:operation DELETE /orgs/{org} organization orgDelete
173
+ // ---
174
+ // summary: Delete an organization
175
+ // produces:
176
+ // - application/json
177
+ // parameters:
178
+ // - name: org
179
+ // in: path
180
+ // description: organization that is to be deleted
181
+ // type: string
182
+ // required: true
183
+ // responses:
184
+ // "204":
185
+ // "$ref": "#/responses/empty"
186
+ if err := models .DeleteOrganization (ctx .Org .Organization ); err != nil {
187
+ ctx .Error (500 , "DeleteOrganization" , err )
188
+ return
189
+ }
190
+ ctx .Status (204 )
191
+ }
Original file line number Diff line number Diff line change 467
467
}
468
468
}
469
469
},
470
+ "delete": {
471
+ "produces": [
472
+ "application/json"
473
+ ],
474
+ "tags": [
475
+ "organization"
476
+ ],
477
+ "summary": "Delete an organization",
478
+ "operationId": "orgDelete",
479
+ "parameters": [
480
+ {
481
+ "type": "string",
482
+ "description": "organization that is to be deleted",
483
+ "name": "org",
484
+ "in": "path",
485
+ "required": true
486
+ }
487
+ ],
488
+ "responses": {
489
+ "204": {
490
+ "$ref": "#/responses/empty"
491
+ }
492
+ }
493
+ },
470
494
"patch": {
471
495
"consumes": [
472
496
"application/json"
You can’t perform that action at this time.
0 commit comments