mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-19 03:03:39 +09:00
Co-authored-by: Rathina Devan E M <emrathinadev@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
co-authored by
Rathina Devan E M
silverwind
parent
bc11b8ac22
commit
e8e8bbdbb5
@@ -1514,10 +1514,10 @@ func Routes() *web.Router {
|
||||
m.Get("/signing-key.pub", misc.SigningKeySSH)
|
||||
m.Group("/topics", func() {
|
||||
m.Combo("").Get(repo.ListTopics).
|
||||
Put(reqToken(), reqAdmin(), bind(api.RepoTopicOptions{}), repo.UpdateTopics)
|
||||
Put(reqToken(), reqAdmin(), mustNotBeArchived, bind(api.RepoTopicOptions{}), repo.UpdateTopics)
|
||||
m.Group("/{topic}", func() {
|
||||
m.Combo("").Put(reqToken(), repo.AddTopic).
|
||||
Delete(reqToken(), repo.DeleteTopic)
|
||||
m.Combo("").Put(reqToken(), mustNotBeArchived, repo.AddTopic).
|
||||
Delete(reqToken(), mustNotBeArchived, repo.DeleteTopic)
|
||||
}, reqAdmin())
|
||||
}, reqAnyRepoReader())
|
||||
m.Get("/issue_templates", reqRepoReader(unit.TypeCode), context.ReferencesGitRepo(), repo.GetIssueTemplates)
|
||||
|
||||
@@ -100,6 +100,8 @@ func UpdateTopics(ctx *context.APIContext) {
|
||||
// "$ref": "#/responses/notFound"
|
||||
// "422":
|
||||
// "$ref": "#/responses/invalidTopicsError"
|
||||
// "423":
|
||||
// "$ref": "#/responses/repoArchivedError"
|
||||
|
||||
form := web.GetForm(ctx).(*api.RepoTopicOptions)
|
||||
topicNames := form.Topics
|
||||
@@ -161,6 +163,8 @@ func AddTopic(ctx *context.APIContext) {
|
||||
// "$ref": "#/responses/notFound"
|
||||
// "422":
|
||||
// "$ref": "#/responses/invalidTopicsError"
|
||||
// "423":
|
||||
// "$ref": "#/responses/repoArchivedError"
|
||||
|
||||
topicName := strings.TrimSpace(strings.ToLower(ctx.PathParam("topic")))
|
||||
|
||||
@@ -228,6 +232,8 @@ func DeleteTopic(ctx *context.APIContext) {
|
||||
// "$ref": "#/responses/notFound"
|
||||
// "422":
|
||||
// "$ref": "#/responses/invalidTopicsError"
|
||||
// "423":
|
||||
// "$ref": "#/responses/repoArchivedError"
|
||||
|
||||
topicName := strings.TrimSpace(strings.ToLower(ctx.PathParam("topic")))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user