feat: create space
This commit is contained in:
parent
8e952455cd
commit
775177cba1
11 changed files with 200 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue