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: #22 #26 Fixed the error in the notification(achievement) source triggered by the adoption answer.

LinkinStarbfd2b9b87ee3
diff --git a/internal/repo/activity/answer_repo.go b/internal/repo/activity/answer_repo.go
index 03aa1409..74ab0db6 100644
--- a/internal/repo/activity/answer_repo.go
+++ b/internal/repo/activity/answer_repo.go
@@ -12,6 +12,7 @@ import (
"github.com/answerdev/answer/internal/service/activity_common"
"github.com/answerdev/answer/internal/service/notice_queue"
"github.com/answerdev/answer/internal/service/rank"
+ "github.com/answerdev/answer/pkg/converter"
"github.com/segmentfault/pacman/errors"
"github.com/segmentfault/pacman/log"
"xorm.io/xorm"
@@ -140,8 +141,10 @@ func (ar *AnswerActivityRepo) AcceptAnswer(ctx context.Context,
}
if action == acceptAction {
addActivity.UserID = questionUserID
+ addActivity.TriggerUserID = converter.StringToInt64(answerUserID)
} else {
addActivity.UserID = answerUserID
+ addActivity.TriggerUserID = converter.StringToInt64(answerUserID)
}
if isSelf {
addActivity.Rank = 0
@@ -193,7 +196,7 @@ func (ar *AnswerActivityRepo) AcceptAnswer(ctx context.Context,
}
if act.UserID == questionUserID {
msg.TriggerUserID = answerUserID
- msg.ObjectType = constant.QuestionObjectType
+ msg.ObjectType = constant.AnswerObjectType
} else {
msg.TriggerUserID = questionUserID
msg.ObjectType = constant.AnswerObjectType