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(plugin): fix rank config about question show/hide

LinkinStars76dfc362c9a0
diff --git a/internal/migrations/init.go b/internal/migrations/init.go
index a2cc8904..cf311cb1 100644
--- a/internal/migrations/init.go
+++ b/internal/migrations/init.go
@@ -366,10 +366,10 @@ func initConfigTable(engine *xorm.Engine) error {
{ID: 116, Key: "rank.question.reopen", Value: `-1`},
{ID: 117, Key: "rank.tag.use_reserved_tag", Value: `-1`},
{ID: 118, Key: "plugin.status", Value: `{}`},
- {ID: 119, Key: "question.pin", Value: `-1`},
- {ID: 120, Key: "question.unpin", Value: `-1`},
- {ID: 121, Key: "question.show", Value: `-1`},
- {ID: 122, Key: "question.hide", Value: `-1`},
+ {ID: 119, Key: "rank.question.pin", Value: `-1`},
+ {ID: 120, Key: "rank.question.unpin", Value: `-1`},
+ {ID: 121, Key: "rank.question.show", Value: `-1`},
+ {ID: 122, Key: "rank.question.hide", Value: `-1`},
}
_, err := engine.Insert(defaultConfigTable)
return err
diff --git a/internal/migrations/v8.go b/internal/migrations/v8.go
index faac7f21..bb739dc8 100644
--- a/internal/migrations/v8.go
+++ b/internal/migrations/v8.go
@@ -63,10 +63,10 @@ func addRolePinAndHideFeatures(x *xorm.Engine) error {
}
defaultConfigTable := []*entity.Config{
- {ID: 119, Key: "question.pin", Value: `-1`},
- {ID: 120, Key: "question.unpin", Value: `-1`},
- {ID: 121, Key: "question.show", Value: `-1`},
- {ID: 122, Key: "question.hide", Value: `-1`},
+ {ID: 119, Key: "rank.question.pin", Value: `-1`},
+ {ID: 120, Key: "rank.question.unpin", Value: `-1`},
+ {ID: 121, Key: "rank.question.show", Value: `-1`},
+ {ID: 122, Key: "rank.question.hide", Value: `-1`},
}
for _, c := range defaultConfigTable {
exist, err := x.Get(&entity.Config{ID: c.ID, Key: c.Key})
diff --git a/internal/service/permission/permission_name.go b/internal/service/permission/permission_name.go
index 1d49ce3f..9262e569 100644
--- a/internal/service/permission/permission_name.go
+++ b/internal/service/permission/permission_name.go
@@ -10,10 +10,10 @@ const (
QuestionReopen = "question.reopen"
QuestionVoteUp = "question.vote_up"
QuestionVoteDown = "question.vote_down"
- QuestionPin = "question.pin" //Top the question
- QuestionUnPin = "question.unpin" //untop the question
- QuestionHide = "question.hide" //hide the question
- QuestionShow = "question.show" //show the question
+ QuestionPin = "question.pin"
+ QuestionUnPin = "question.unpin"
+ QuestionHide = "question.hide"
+ QuestionShow = "question.show"
AnswerAdd = "answer.add"
AnswerEdit = "answer.edit"
AnswerEditWithoutReview = "answer.edit_without_review"