mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/0.5.0/timeline_ai' of git.backyard.segmentfault.com:opensource/answer into feat/0.5.0/timeline_ai
This commit is contained in:
commit
a27b0013d5
|
@ -179,21 +179,12 @@ func (ac *AnswerController) Update(ctx *gin.Context) {
|
|||
handler.HandleResponse(ctx, err, nil)
|
||||
return
|
||||
}
|
||||
info, questionInfo, has, err := ac.answerService.Get(ctx, req.ID, req.UserID)
|
||||
_, _, _, err = ac.answerService.Get(ctx, req.ID, req.UserID)
|
||||
if err != nil {
|
||||
handler.HandleResponse(ctx, err, nil)
|
||||
return
|
||||
}
|
||||
if !has {
|
||||
// todo !has
|
||||
handler.HandleResponse(ctx, nil, nil)
|
||||
return
|
||||
}
|
||||
handler.HandleResponse(ctx, nil, &schema.AnswerUpdateResp{
|
||||
AnswerInfo: info,
|
||||
QuestionInfo: questionInfo,
|
||||
WaitForReview: !req.NoNeedReview,
|
||||
})
|
||||
handler.HandleResponse(ctx, nil, &schema.AnswerUpdateResp{WaitForReview: !req.NoNeedReview})
|
||||
}
|
||||
|
||||
// AnswerList godoc
|
||||
|
|
|
@ -266,8 +266,8 @@ func (qc *QuestionController) UpdateQuestion(ctx *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
resp, err := qc.questionService.UpdateQuestion(ctx, req)
|
||||
handler.HandleResponse(ctx, err, resp)
|
||||
_, err = qc.questionService.UpdateQuestion(ctx, req)
|
||||
handler.HandleResponse(ctx, err, &schema.UpdateQuestionResp{WaitForReview: !req.NoNeedReview})
|
||||
}
|
||||
|
||||
// CloseMsgList close question msg list
|
||||
|
|
|
@ -36,9 +36,7 @@ type AnswerUpdateReq struct {
|
|||
|
||||
// AnswerUpdateResp answer update resp
|
||||
type AnswerUpdateResp struct {
|
||||
AnswerInfo *AnswerInfo `json:"info"`
|
||||
QuestionInfo *QuestionInfo `json:"question"`
|
||||
WaitForReview bool `json:"wait_for_review"`
|
||||
WaitForReview bool `json:"wait_for_review"`
|
||||
}
|
||||
|
||||
type AnswerListReq struct {
|
||||
|
|
|
@ -120,6 +120,11 @@ type QuestionInfo struct {
|
|||
MemberActions []*PermissionMemberAction `json:"member_actions"`
|
||||
}
|
||||
|
||||
// UpdateQuestionResp update question resp
|
||||
type UpdateQuestionResp struct {
|
||||
WaitForReview bool `json:"wait_for_review"`
|
||||
}
|
||||
|
||||
type AdminQuestionInfo struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
|
|
Loading…
Reference in New Issue