Skip to content

Commit 13b5cef

Browse files
committed
dont use deprecadet comment api path | use current
1 parent 1b4b4b9 commit 13b5cef

File tree

3 files changed

+150
-187
lines changed

3 files changed

+150
-187
lines changed

routers/api/v1/api.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,15 @@ func RegisterRoutes(m *macaron.Macaron) {
657657
Post(reqToken(), mustNotBeArchived, bind(api.CreateIssueOption{}), repo.CreateIssue)
658658
m.Group("/comments", func() {
659659
m.Get("", repo.ListRepoIssueComments)
660-
m.Combo("/:id", reqToken()).
661-
Patch(mustNotBeArchived, bind(api.EditIssueCommentOption{}), repo.EditIssueComment).
662-
Delete(repo.DeleteIssueComment)
660+
m.Group("/:id", func() {
661+
m.Combo("", reqToken()).
662+
Patch(mustNotBeArchived, bind(api.EditIssueCommentOption{}), repo.EditIssueComment).
663+
Delete(repo.DeleteIssueComment)
664+
m.Combo("/reactions").
665+
Get(bind(api.CommentReactionList{}), repo.GetCommentReactions).
666+
Put(reqToken(), bind(api.CommentReaction{}), repo.AddCommentReaction).
667+
Delete(reqToken(), bind(api.CommentReaction{}), repo.DelCommentReaction)
668+
})
663669
})
664670
m.Group("/:index", func() {
665671
m.Combo("").Get(repo.GetIssue).
@@ -668,15 +674,8 @@ func RegisterRoutes(m *macaron.Macaron) {
668674
m.Group("/comments", func() {
669675
m.Combo("").Get(repo.ListIssueComments).
670676
Post(reqToken(), mustNotBeArchived, bind(api.CreateIssueCommentOption{}), repo.CreateIssueComment)
671-
m.Group("/:id", func() {
672-
m.Combo("", reqToken()).
673-
Patch(bind(api.EditIssueCommentOption{}), repo.EditIssueCommentDeprecated).
674-
Delete(repo.DeleteIssueCommentDeprecated)
675-
m.Combo("/reactions").
676-
Get(bind(api.CommentReactionList{}), repo.GetCommentReactions).
677-
Put(reqToken(), bind(api.CommentReaction{}), repo.AddCommentReaction).
678-
Delete(reqToken(), bind(api.CommentReaction{}), repo.DelCommentReaction)
679-
})
677+
m.Combo("/:id", reqToken()).Patch(bind(api.EditIssueCommentOption{}), repo.EditIssueCommentDeprecated).
678+
Delete(repo.DeleteIssueCommentDeprecated)
680679
})
681680

682681
m.Group("/labels", func() {

routers/api/v1/repo/issue_comment.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ func deleteIssueComment(ctx *context.APIContext) {
396396

397397
//GetCommentReactions return all reactions of a specific comment
398398
func GetCommentReactions(ctx *context.APIContext, form api.CommentReactionList) {
399-
// swagger:operation GET /repos/{owner}/{repo}/issues/{index}/comments/{id}/reactions issue issueGetCommentReactions
399+
// swagger:operation GET /repos/{owner}/{repo}/issues/comments/{id}/reactions issue issueGetCommentReactions
400400
// ---
401401
// summary: Return all reactions of a specific comment
402402
// consumes:
@@ -414,11 +414,6 @@ func GetCommentReactions(ctx *context.APIContext, form api.CommentReactionList)
414414
// description: name of the repo
415415
// type: string
416416
// required: true
417-
// - name: index
418-
// in: path
419-
// description: index of the issue
420-
// type: integer
421-
// required: true
422417
// - name: id
423418
// in: path
424419
// description: id of the comment
@@ -453,7 +448,7 @@ func GetCommentReactions(ctx *context.APIContext, form api.CommentReactionList)
453448

454449
// AddCommentReaction create a reaction to a comment
455450
func AddCommentReaction(ctx *context.APIContext, form api.CommentReaction) {
456-
// swagger:operation PUT /repos/{owner}/{repo}/issues/{index}/comments/{id}/reactions issue issueAddCommentReaction
451+
// swagger:operation PUT /repos/{owner}/{repo}/issues/comments/{id}/reactions issue issueAddCommentReaction
457452
// ---
458453
// summary: Create reaction to a comment
459454
// consumes:
@@ -471,11 +466,6 @@ func AddCommentReaction(ctx *context.APIContext, form api.CommentReaction) {
471466
// description: name of the repo
472467
// type: string
473468
// required: true
474-
// - name: index
475-
// in: path
476-
// description: index of the issue
477-
// type: integer
478-
// required: true
479469
// - name: id
480470
// in: path
481471
// description: id of the comment
@@ -498,7 +488,7 @@ func AddCommentReaction(ctx *context.APIContext, form api.CommentReaction) {
498488

499489
// DelCommentReaction delete a reaction to a comment
500490
func DelCommentReaction(ctx *context.APIContext, form api.CommentReaction) {
501-
// swagger:operation DELETE /repos/{owner}/{repo}/issues/{index}/comments/{id}/reactions issue issueDelCommentReaction
491+
// swagger:operation DELETE /repos/{owner}/{repo}/issues/comments/{id}/reactions issue issueDelCommentReaction
502492
// ---
503493
// summary: Delete reaction to a comment
504494
// consumes:
@@ -516,11 +506,6 @@ func DelCommentReaction(ctx *context.APIContext, form api.CommentReaction) {
516506
// description: name of the repo
517507
// type: string
518508
// required: true
519-
// - name: index
520-
// in: path
521-
// description: index of the issue
522-
// type: integer
523-
// required: true
524509
// - name: id
525510
// in: path
526511
// description: id of the comment

0 commit comments

Comments
 (0)