1
0
Fork 0
forked from forgejo/forgejo

Move user/org deletion to services (#17673)

This commit is contained in:
KN4CK3R 2021-11-18 18:42:27 +01:00 committed by GitHub
parent 55be5fe339
commit f34151bdb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 382 additions and 301 deletions

View file

@ -16,6 +16,7 @@ import (
"code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/routers/api/v1/user"
"code.gitea.io/gitea/routers/api/v1/utils"
"code.gitea.io/gitea/services/org"
)
func listUserOrgs(ctx *context.APIContext, u *models.User) {
@ -364,7 +365,7 @@ func Delete(ctx *context.APIContext) {
// "204":
// "$ref": "#/responses/empty"
if err := models.DeleteOrganization(ctx.Org.Organization); err != nil {
if err := org.DeleteOrganization(ctx.Org.Organization); err != nil {
ctx.Error(http.StatusInternalServerError, "DeleteOrganization", err)
return
}