diff --git a/internal/api/handler/list.go b/internal/api/handler/list.go index 60218c3..740f431 100644 --- a/internal/api/handler/list.go +++ b/internal/api/handler/list.go @@ -14,8 +14,8 @@ type ListHandler struct { UserService *domain.UserService } -func NewListHandler(listService *domain.ListService) *ListHandler { - return &ListHandler{ListService: listService} +func NewListHandler(listService *domain.ListService, userService *domain.UserService) *ListHandler { + return &ListHandler{ListService: listService, UserService: userService} } // CreateList handles the creation of a list diff --git a/internal/api/router/router.go b/internal/api/router/router.go index 17d5277..105013b 100644 --- a/internal/api/router/router.go +++ b/internal/api/router/router.go @@ -26,7 +26,7 @@ func NewMux(cfg Config) http.Handler { listRepo := repository.NewListRepo(cfg.Database) listService := domain.NewListService(listRepo) - listHandler := handler.NewListHandler(listService) + listHandler := handler.NewListHandler(listService, userService) protected := middleware.WithJWT(authService)