From deee3e0d4f70b5f627ce3010e3dd7bdf1e75aca3 Mon Sep 17 00:00:00 2001 From: Robin Dittmar Date: Fri, 21 Aug 2026 22:05:43 +0200 Subject: [PATCH] fix: correctly injecting UserService into ListHandler --- internal/api/handler/list.go | 4 ++-- internal/api/router/router.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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) -- 2.54.0