update revision

This commit is contained in:
aichy126 2023-03-24 12:21:09 +08:00
parent 629a917f4d
commit 82307f9c6b
2 changed files with 10 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/answerdev/answer/internal/base/handler"
"github.com/answerdev/answer/internal/base/middleware"
"github.com/answerdev/answer/internal/base/reason"
"github.com/answerdev/answer/internal/entity"
"github.com/answerdev/answer/internal/schema"
"github.com/answerdev/answer/internal/service"
"github.com/answerdev/answer/internal/service/permission"
@ -52,7 +53,13 @@ func (rc *RevisionController) GetRevisionList(ctx *gin.Context) {
}
resp, err := rc.revisionListService.GetRevisionList(ctx, req)
handler.HandleResponse(ctx, err, resp)
list := make([]schema.GetRevisionResp, 0)
for _, item := range resp {
if item.Status == entity.RevisioNnormalStatus || item.Status == entity.RevisionReviewPassStatus {
list = append(list, item)
}
}
handler.HandleResponse(ctx, err, list)
}
// GetUnreviewedRevisionList godoc

View File

@ -5,6 +5,8 @@ import (
)
const (
// RevisioNnormalStatus this revision is Nnormal
RevisioNnormalStatus = 0
// RevisionUnreviewedStatus this revision is unreviewed
RevisionUnreviewedStatus = 1
// RevisionReviewPassStatus this revision is reviewed and approved by operator