Merge pull request 'Injecting UserService into ListHandler' (#23) from dev into main
This commit was merged in pull request #23.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user