fix: can now create a list without any additional user IDs

This commit is contained in:
2026-08-21 14:20:40 +02:00
parent 5e23d9cc9f
commit ea5dd431e5
-5
View File
@@ -11,7 +11,6 @@ var (
ErrListIDEmpty = errors.New("list id must not be empty") ErrListIDEmpty = errors.New("list id must not be empty")
ErrListNameEmpty = errors.New("list name must not be empty") ErrListNameEmpty = errors.New("list name must not be empty")
ErrUserIDEmpty = errors.New("user id must not be empty") ErrUserIDEmpty = errors.New("user id must not be empty")
ErrUserIDsEmpty = errors.New("user ids must not be empty")
ErrListItemIDEmpty = errors.New("list item id must not be empty") ErrListItemIDEmpty = errors.New("list item id must not be empty")
ErrListItemTitleEmpty = errors.New("list item title must not be empty") ErrListItemTitleEmpty = errors.New("list item title must not be empty")
ErrUserNotInList = errors.New("user not in list") ErrUserNotInList = errors.New("user not in list")
@@ -52,10 +51,6 @@ func NewListService(r ListRepository) *ListService {
} }
func (s *ListService) Create(ctx context.Context, authUserID string, name string, userIDs []string) (*List, error) { func (s *ListService) Create(ctx context.Context, authUserID string, name string, userIDs []string) (*List, error) {
if len(userIDs) == 0 {
return nil, ErrUserIDsEmpty
}
if name == "" { if name == "" {
return nil, ErrListNameEmpty return nil, ErrListNameEmpty
} }