(c *context.Context)
| 64 | } |
| 65 | |
| 66 | func DeleteRepo(c *context.Context) { |
| 67 | repo, err := database.GetRepositoryByID(c.QueryInt64("id")) |
| 68 | if err != nil { |
| 69 | c.Error(err, "get repository by ID") |
| 70 | return |
| 71 | } |
| 72 | |
| 73 | if err := database.DeleteRepository(repo.MustOwner().ID, repo.ID); err != nil { |
| 74 | c.Error(err, "delete repository") |
| 75 | return |
| 76 | } |
| 77 | log.Trace("Repository deleted: %s/%s", repo.MustOwner().Name, repo.Name) |
| 78 | |
| 79 | c.Flash.Success(c.Tr("repo.settings.deletion_success")) |
| 80 | c.JSONSuccess(map[string]any{ |
| 81 | "redirect": conf.Server.Subpath + "/admin/repos?page=" + c.Query("page"), |
| 82 | }) |
| 83 | } |
nothing calls this directly
no test coverage detected