fix: 修复了自己关注自己的bug
This commit is contained in:
@@ -24,6 +24,9 @@ func (s *SocialService) Follow(ctx context.Context, social *Social) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if social.FollowerID == social.VloggerID {
|
||||||
|
return errors.New("can not follow self")
|
||||||
|
}
|
||||||
isFollowed, err := s.repo.IsFollowed(ctx, social)
|
isFollowed, err := s.repo.IsFollowed(ctx, social)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user