(c *context.Context)
| 541 | } |
| 542 | |
| 543 | func SettingsLeaveRepo(c *context.Context) { |
| 544 | repo, err := database.GetRepositoryByID(c.QueryInt64("id")) |
| 545 | if err != nil { |
| 546 | c.NotFoundOrError(err, "get repository by ID") |
| 547 | return |
| 548 | } |
| 549 | |
| 550 | if err = repo.DeleteCollaboration(c.User.ID); err != nil { |
| 551 | c.Errorf(err, "delete collaboration") |
| 552 | return |
| 553 | } |
| 554 | |
| 555 | c.Flash.Success(c.Tr("settings.repos.leave_success", repo.FullName())) |
| 556 | c.JSONSuccess(map[string]any{ |
| 557 | "redirect": conf.Server.Subpath + "/user/settings/repositories", |
| 558 | }) |
| 559 | } |
| 560 | |
| 561 | func SettingsOrganizations(c *context.Context) { |
| 562 | c.Title("settings.orgs") |
nothing calls this directly
no test coverage detected