fix: correctly injecting UserService into ListHandler

This commit is contained in:
2026-08-21 22:05:43 +02:00
parent ff0fe5ff13
commit deee3e0d4f
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ type ListHandler struct {
UserService *domain.UserService UserService *domain.UserService
} }
func NewListHandler(listService *domain.ListService) *ListHandler { func NewListHandler(listService *domain.ListService, userService *domain.UserService) *ListHandler {
return &ListHandler{ListService: listService} return &ListHandler{ListService: listService, UserService: userService}
} }
// CreateList handles the creation of a list // CreateList handles the creation of a list
+1 -1
View File
@@ -26,7 +26,7 @@ func NewMux(cfg Config) http.Handler {
listRepo := repository.NewListRepo(cfg.Database) listRepo := repository.NewListRepo(cfg.Database)
listService := domain.NewListService(listRepo) listService := domain.NewListService(listRepo)
listHandler := handler.NewListHandler(listService) listHandler := handler.NewListHandler(listService, userService)
protected := middleware.WithJWT(authService) protected := middleware.WithJWT(authService)