Merge branch 'feat/0.5.0/timeline_ai' into test

This commit is contained in:
LinkinStar 2022-12-02 15:14:52 +08:00
commit 7eb6f9a295
2 changed files with 7 additions and 6 deletions

View File

@ -159,6 +159,6 @@ func (rc *RevisionController) CheckCanUpdateRevision(ctx *gin.Context) {
return
}
err = rc.revisionListService.CheckCanUpdateRevision(ctx, req)
handler.HandleResponse(ctx, err, nil)
resp, err := rc.revisionListService.CheckCanUpdateRevision(ctx, req)
handler.HandleResponse(ctx, err, resp)
}

View File

@ -386,13 +386,14 @@ func (rs *RevisionService) parseItem(ctx context.Context, item *schema.GetRevisi
}
// CheckCanUpdateRevision can check revision
func (rs *RevisionService) CheckCanUpdateRevision(ctx context.Context, req *schema.CheckCanQuestionUpdate) (err error) {
func (rs *RevisionService) CheckCanUpdateRevision(ctx context.Context, req *schema.CheckCanQuestionUpdate) (
resp *schema.ErrTypeData, err error) {
_, exist, err := rs.revisionRepo.ExistUnreviewedByObjectID(ctx, req.ID)
if err != nil {
return err
return nil, nil
}
if exist {
return errors.BadRequest(reason.RevisionReviewUnderway)
return &schema.ErrTypeToast, errors.BadRequest(reason.RevisionReviewUnderway)
}
return nil
return nil, nil
}