feat: add folloers/following list

This commit is contained in:
Krispire Admin
2026-06-09 13:20:14 +05:30
parent 0188a34cf6
commit da2bbc323d
5 changed files with 126 additions and 0 deletions
+19
View File
@@ -310,6 +310,25 @@ func (s *SocialGraphService) Counts(ctx context.Context, userID string) (followe
return followers, following, nil
}
// Followers / Following resolve the handle and return one page of the
// profile's accepted followers (or followings), optionally filtered by a
// name/handle search `q`, plus the total matching count for pagination.
func (s *SocialGraphService) Followers(ctx context.Context, handle, q string, limit, offset int) ([]model.UserSummary, int, error) {
u, err := s.users.FindByHandle(ctx, handle)
if err != nil {
return nil, 0, err
}
return s.follows.ListFollowers(ctx, u.ID, q, limit, offset)
}
func (s *SocialGraphService) Following(ctx context.Context, handle, q string, limit, offset int) ([]model.UserSummary, int, error) {
u, err := s.users.FindByHandle(ctx, handle)
if err != nil {
return nil, 0, err
}
return s.follows.ListFollowing(ctx, u.ID, q, limit, offset)
}
// ProfileExtras is the read used by the public-profile endpoint: the
// target's follower/following counts plus, when a non-owner viewer is
// signed in, their relationship to the target. rel is nil for anonymous