Fix namespace issue and small name refactoring #17

Merged
robin merged 2 commits from dev into main 2026-08-21 14:52:07 +02:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ type ListItem struct {
type ListRepository interface {
CreateList(ctx context.Context, name string, userIDs []string) (*List, error)
GetListsByUserID(ctx context.Context, userID string) ([]domain.List, error)
GetLists(ctx context.Context, userID string) ([]List, error)
AddUserToList(ctx context.Context, listID string, userID string) error
RemoveUserFromList(ctx context.Context, listID string, userID string) error
IsUserInList(ctx context.Context, listID string, userID string) (bool, error)
@@ -67,7 +67,7 @@ func (s *ListService) Create(ctx context.Context, authUserID string, name string
}
func (s *ListService) GetLists(ctx context.Context, authUserID string) ([]List, error) {
return s.repo.GetListsByUserID(ctx, authUserID)
return s.repo.GetLists(ctx, authUserID)
}
func (s *ListService) AddUserToList(ctx context.Context, authUserID string, listID string, userID string) error {
+1 -1
View File
@@ -58,7 +58,7 @@ func (r *ListRepo) CreateList(ctx context.Context, name string, userIDs []string
return list, nil
}
func (r *ListRepo) GetListsByUserID(ctx context.Context, userID string) ([]domain.List, error) {
func (r *ListRepo) GetLists(ctx context.Context, userID string) ([]domain.List, error) {
rows, err := r.db.QueryContext(ctx,
"SELECT id, name, created_at, modified_at FROM lists JOIN list_users ON list.id=list_users.list_id WHERE list_users.user_id = $1",
userID,