refactor: renamed "ownerID" => "authUserID" for clarity

This commit is contained in:
2026-08-20 15:32:12 +02:00
parent d80a17f16a
commit a5d649dbf5
+5 -5
View File
@@ -39,7 +39,7 @@ func NewListService(r ListRepository) *ListService {
return &ListService{repo: r} return &ListService{repo: r}
} }
func (s *ListService) Create(ctx context.Context, 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 { if len(userIDs) == 0 {
return nil, errors.New("users must have at least one associated user") return nil, errors.New("users must have at least one associated user")
} }
@@ -51,7 +51,7 @@ func (s *ListService) Create(ctx context.Context, name string, userIDs []string)
return s.repo.CreateList(ctx, name, userIDs) return s.repo.CreateList(ctx, name, userIDs)
} }
func (s *ListService) AddUserToList(ctx context.Context, ownerID string, listID string, userID string) error { func (s *ListService) AddUserToList(ctx context.Context, authUserID string, listID string, userID string) error {
if listID == "" { if listID == "" {
return errors.New("list id must not be empty") return errors.New("list id must not be empty")
} }
@@ -62,7 +62,7 @@ func (s *ListService) AddUserToList(ctx context.Context, ownerID string, listID
return s.repo.AddUserToList(ctx, listID, userID) return s.repo.AddUserToList(ctx, listID, userID)
} }
func (s *ListService) RemoveUserFromList(ctx context.Context, ownerID string, listID string, userID string) error { func (s *ListService) RemoveUserFromList(ctx context.Context, authUserID string, listID string, userID string) error {
if listID == "" { if listID == "" {
return errors.New("list id must not be empty") return errors.New("list id must not be empty")
} }
@@ -73,7 +73,7 @@ func (s *ListService) RemoveUserFromList(ctx context.Context, ownerID string, li
return s.repo.RemoveUserFromList(ctx, listID, userID) return s.repo.RemoveUserFromList(ctx, listID, userID)
} }
func (s *ListService) CreateListItem(ctx context.Context, ownerID string, listID string, title string) (*ListItem, error) { func (s *ListService) CreateListItem(ctx context.Context, authUserID string, listID string, title string) (*ListItem, error) {
if listID == "" { if listID == "" {
return nil, errors.New("list id must not be empty") return nil, errors.New("list id must not be empty")
} }
@@ -84,7 +84,7 @@ func (s *ListService) CreateListItem(ctx context.Context, ownerID string, listID
return s.repo.CreateListItem(ctx, listID, title) return s.repo.CreateListItem(ctx, listID, title)
} }
func (s *ListService) UpdateListItem(ctx context.Context, ownerID string, listItemID string, title string, isCompleted bool) error { func (s *ListService) UpdateListItem(ctx context.Context, authUserID string, listItemID string, title string, isCompleted bool) error {
if listItemID == "" { if listItemID == "" {
return errors.New("list item id must not be empty") return errors.New("list item id must not be empty")
} }