chore: count space members without retrieving all member info
save some RAM
This commit is contained in:
parent
08f806e405
commit
b48fcbfaa6
3 changed files with 24 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue