chore: count space members without retrieving all member info

save some RAM
This commit is contained in:
juancwu 2026-04-11 17:50:16 +00:00
commit b48fcbfaa6
3 changed files with 24 additions and 5 deletions

View file

@ -94,3 +94,11 @@ func (s *SpaceService) UpdateSpaceName(spaceID, name string) error {
func (s *SpaceService) DeleteSpace(spaceID string) error {
return s.spaceRepo.Delete(spaceID)
}
func (s *SpaceService) GetMemberCount(spaceID string) (int, error) {
count, err := s.spaceRepo.GetMemberCount(spaceID)
if err != nil {
return 0, fmt.Errorf("failed to get member count: %w", err)
}
return count, nil
}