feat: create space

This commit is contained in:
juancwu 2026-04-11 21:46:52 +00:00
commit 775177cba1
11 changed files with 200 additions and 3 deletions

View file

@ -102,3 +102,18 @@ func (s *SpaceService) GetMemberCount(spaceID string) (int, error) {
}
return count, nil
}
func (s *SpaceService) IsNameAvailable(name string, userID string) (bool, error) {
spaces, err := s.GetSpacesForUser(userID)
if err != nil {
return false, fmt.Errorf("failed to get spaces to check name availability: %w", err)
}
for _, sp := range spaces {
if sp.Name == name {
return false, nil
}
}
return true, nil
}