LinkinStars commented on code in PR #660:
URL: https://github.com/apache/incubator-answer/pull/660#discussion_r1407392705
##########
internal/repo/search_common/search_repo.go:
##########
@@ -483,10 +485,19 @@ func (sr *searchRepo) parseResult(ctx context.Context,
res []map[string][]byte)
questionIDs = append(questionIDs, string(r["question_id"]))
userIDs = append(userIDs, string(r["user_id"]))
tp, _ := time.ParseInLocation("2006-01-02 15:04:05",
string(r["created_at"]), time.Local)
+
+ ID := string(r["id"])
+ QuestionID := string(r["question_id"])
Review Comment:
Using `id` and `questionID` for variable name would be better.
##########
ui/src/pages/Questions/Ask/index.tsx:
##########
@@ -288,7 +288,7 @@ const Ask = () => {
modifyQuestion(ep)
.then(async (res) => {
await editCaptcha.close();
- navigate(pathFactory.questionLanding(qid, params.url_title), {
+ navigate(pathFactory.questionLanding(qid, res?.url_title), {
Review Comment:
@shuashuai Help to review it.
##########
internal/schema/question_schema.go:
##########
@@ -205,6 +205,7 @@ func (req *QuestionUpdate) Check() (errFields
[]*validator.FormErrorField, err e
type QuestionBaseInfo struct {
ID string `json:"id" `
Title string `json:"title" xorm:"title"`
// title
+ UrlTitle string `json:"url_title" xorm:"url_title"`
// title
ViewCount int `json:"view_count" xorm:"view_count"`
// view count
AnswerCount int `json:"answer_count" xorm:"answer_count"`
// answer count
CollectionCount int `json:"collection_count"
xorm:"collection_count"` // collection count
Review Comment:
The `xorm tag` here must have been misused by someone else, please help me
remove it. And remove the final comments, which are redundant. Thanks a lot.
##########
internal/service/question_common/question.go:
##########
@@ -591,8 +591,13 @@ func (qs *QuestionCommon) ShowListFormat(ctx
context.Context, data *entity.Quest
}
func (qs *QuestionCommon) ShowFormat(ctx context.Context, data
*entity.Question) *schema.QuestionInfo {
+ ID := data.ID
Review Comment:
Using `id` for variable name would be better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]