LinkinStars commented on code in PR #1213:
URL: https://github.com/apache/incubator-answer/pull/1213#discussion_r1900609696


##########
internal/repo/badge/badge_repo.go:
##########
@@ -149,3 +149,12 @@ func (r *badgeRepo) UpdateAwardCount(ctx context.Context, 
badgeID string, awardC
        }
        return
 }
+
+// DeleteUserBadge delete user badge
+func (r *badgeRepo) DeleteUserBadge(ctx context.Context, userID string) (err 
error) {
+       _, err = r.data.DB.Context(ctx).Where("user_id = ?", 
userID).Delete(&entity.BadgeAward{})
+       if err != nil {
+               err = 
errors.InternalServer(reason.DatabaseError).WithError(err).WithStack()
+       }
+       return
+}

Review Comment:
   Maybe putting this function to the `repo/badge_award/badge_award_repo.go` 
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]

Reply via email to