update question

This commit is contained in:
aichy126 2023-04-13 18:39:06 +08:00
parent 0124cfc435
commit 0c533e554d
1 changed files with 3 additions and 0 deletions

View File

@ -270,6 +270,8 @@ func (qs *QuestionService) AddQuestion(ctx context.Context, req *schema.Question
question.Status = entity.QuestionStatusAvailable
question.RevisionID = "0"
question.CreatedAt = now
question.Pin = entity.QuestionUnPin
question.Show = entity.QuestionShow
//question.UpdatedAt = nil
err = qs.questionRepo.AddQuestion(ctx, question)
if err != nil {
@ -698,6 +700,7 @@ func (qs *QuestionService) GetQuestion(ctx context.Context, questionID, userID s
per.CanHide = false
per.CanPin = false
}
if question.Status == entity.QuestionStatusDeleted {
operation := &schema.Operation{}
operation.Msg = translator.Tr(handler.GetLangByCtx(ctx), reason.QuestionAlreadyDeleted)