Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix router

aichy1269fb1d82a5b26
diff --git a/internal/controller/question_controller.go b/internal/controller/question_controller.go
index 7e708ba7..1ea03644 100644
--- a/internal/controller/question_controller.go
+++ b/internal/controller/question_controller.go
@@ -234,7 +234,7 @@ func (qc *QuestionController) UpdateQuestion(ctx *gin.Context) {
// @Security ApiKeyAuth
// @Param id query string true "id" default(string)
// @Success 200 {object} handler.RespBody
-// @Router /answer/api/v1/question/edit/check [get]
+// @Router /answer/api/v1/revisions/edit/check [get]
func (qc *QuestionController) CheckCanUpdateQuestion(ctx *gin.Context) {
req := &schema.CheckCanQuestionUpdate{}
if handler.BindAndCheck(ctx, req) {
diff --git a/internal/router/answer_api_router.go b/internal/router/answer_api_router.go
index 80525787..c45aa659 100644
--- a/internal/router/answer_api_router.go
+++ b/internal/router/answer_api_router.go
@@ -147,6 +147,7 @@ func (a *AnswerAPIRouter) RegisterAnswerAPIRouter(r *gin.RouterGroup) {
//revisions
r.GET("/revisions/unreviewed", a.revisionController.GetUnreviewedRevisionList)
r.PUT("/revisions/audit", a.revisionController.RevisionAudit)
+ r.GET("/revisions/edit/check", a.questionController.CheckCanUpdateQuestion)
// comment
r.POST("/comment", a.commentController.AddComment)
@@ -177,7 +178,6 @@ func (a *AnswerAPIRouter) RegisterAnswerAPIRouter(r *gin.RouterGroup) {
// question
r.POST("/question", a.questionController.AddQuestion)
r.PUT("/question", a.questionController.UpdateQuestion)
- r.GET("/question/edit/check", a.questionController.CheckCanUpdateQuestion)
r.DELETE("/question", a.questionController.RemoveQuestion)
r.PUT("/question/status", a.questionController.CloseQuestion)
r.GET("/question/similar", a.questionController.SearchByTitleLike)