fix: rename GetListsByUserID to GetLists for consistency
This commit is contained in:
@@ -35,7 +35,7 @@ type ListItem struct {
|
|||||||
|
|
||||||
type ListRepository interface {
|
type ListRepository interface {
|
||||||
CreateList(ctx context.Context, name string, userIDs []string) (*List, error)
|
CreateList(ctx context.Context, name string, userIDs []string) (*List, error)
|
||||||
GetListsByUserID(ctx context.Context, userID string) ([]List, error)
|
GetLists(ctx context.Context, userID string) ([]List, error)
|
||||||
AddUserToList(ctx context.Context, listID string, userID string) error
|
AddUserToList(ctx context.Context, listID string, userID string) error
|
||||||
RemoveUserFromList(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)
|
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) {
|
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 {
|
func (s *ListService) AddUserToList(ctx context.Context, authUserID string, listID string, userID string) error {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ func (r *ListRepo) CreateList(ctx context.Context, name string, userIDs []string
|
|||||||
return list, nil
|
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,
|
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",
|
"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,
|
userID,
|
||||||
|
|||||||
Reference in New Issue
Block a user