Repository: gogs/gogs
File: internal/route/api/v1/api.go (Go)

Code before:
				}, mustEnableIssues)

				m.Group("/labels", func() {
					m.Get("", repo2.ListLabels)
					m.Get("/:id", repo2.GetLabel)
				})
				m.Group("/labels", func() {
					m.Post("", bind(api.CreateLabelOption{}), repo2.CreateLabel)
					m.Combo("/:id").
						Patch(bind(api.EditLabelOption{}), repo2.EditLabel).
						Delete(repo2.DeleteLabel)
				}, reqRepoWriter())

				m.Group("/milestones", func() {
					m.Get("", repo2.ListMilestones)
					m.Get("/:id", repo2.GetMilestone)
				})
				m.Group("/milestones", func() {
					m.Post("", bind(api.CreateMilestoneOption{}), repo2.CreateMilestone)
					m.Combo("/:id").
						Patch(bind(api.EditMilestoneOption{}), repo2.EditMilestone).
						Delete(repo2.DeleteMilestone)
				}, reqRepoWriter())

				m.Patch("/issue-tracker", reqRepoWriter(), bind(api.EditIssueTrackerOption{}), repo2.IssueTracker)
				m.Post("/wiki", reqRepoWriter(), bind(api.EditWikiOption{}), repo2.Wiki)
				m.Post("/mirror-sync", reqRepoWriter(), repo2.MirrorSync)
				m.Get("/editorconfig/:filename", context.RepoRef(), repo2.GetEditorconfig)
			}, repoAssignment())
		}, reqToken())

		m.Get("/issues", reqToken(), repo2.ListUserIssues)

		// Organizations
		m.Combo("/user/orgs", reqToken()).
			Get(org2.ListMyOrgs).
			Post(bind(api.CreateOrgOption{}), org2.CreateMyOrg)

		m.Get("/users/:username/orgs", org2.ListUserOrgs)
		m.Group("/orgs/:orgname", func() {
			m.Combo("").
				Get(org2.Get).
				Patch(bind(api.EditOrgOption{}), org2.Edit)
			m.Get("/teams", org2.ListTeams)
		}, orgAssignment(true))

		m.Group("/admin", func() {
			m.Group("/users", func() {
				m.Post("", bind(api.CreateUserOption{}), admin2.CreateUser)

				m.Group("/:username", func() {

Review comment (suggestion):
```suggestion
				m.Patch("/wiki", reqRepoWriter(), bind(api.EditWikiOption{}), repo2.Wiki)
```

Code after:
						m.Get("/labels", repo.ListIssueLabels)
						m.Group("/labels", func() {
							m.Combo("").
								Post(bind(api.IssueLabelsOption{}), repo.AddIssueLabels).
								Put(bind(api.IssueLabelsOption{}), repo.ReplaceIssueLabels).
								Delete(repo.ClearIssueLabels)
							m.Delete("/:id", repo.DeleteIssueLabel)
						}, reqRepoWriter())
					})
				}, mustEnableIssues)

				m.Group("/labels", func() {
					m.Get("", repo.ListLabels)
					m.Get("/:id", repo.GetLabel)
				})
				m.Group("/labels", func() {
					m.Post("", bind(api.CreateLabelOption{}), repo.CreateLabel)
					m.Combo("/:id").
						Patch(bind(api.EditLabelOption{}), repo.EditLabel).
						Delete(repo.DeleteLabel)
				}, reqRepoWriter())

				m.Group("/milestones", func() {
					m.Get("", repo.ListMilestones)
					m.Get("/:id", repo.GetMilestone)
				})
				m.Group("/milestones", func() {
					m.Post("", bind(api.CreateMilestoneOption{}), repo.CreateMilestone)
					m.Combo("/:id").
						Patch(bind(api.EditMilestoneOption{}), repo.EditMilestone).
						Delete(repo.DeleteMilestone)
				}, reqRepoWriter())

				m.Patch("/issue-tracker", reqRepoWriter(), bind(api.EditIssueTrackerOption{}), repo.IssueTracker)
				m.Patch("/wiki", reqRepoWriter(), bind(api.EditWikiOption{}), repo.Wiki)
				m.Post("/mirror-sync", reqRepoWriter(), repo.MirrorSync)
				m.Get("/editorconfig/:filename", context.RepoRef(), repo.GetEditorconfig)
			}, repoAssignment())
		}, reqToken())

		m.Get("/issues", reqToken(), repo.ListUserIssues)

		// Organizations
		m.Combo("/user/orgs", reqToken()).
			Get(org.ListMyOrgs).
			Post(bind(api.CreateOrgOption{}), org.CreateMyOrg)

		m.Get("/users/:username/orgs", org.ListUserOrgs)
		m.Group("/orgs/:orgname", func() {
			m.Combo("").
				Get(org.Get).