add: contactController,tests & refactored tests
This commit is contained in:
@@ -30,7 +30,7 @@ func Run() {
|
||||
logger.Error.Fatalf("Couldn't init database: %v", err)
|
||||
}
|
||||
|
||||
emailService := services.NewEmailService(config.SMTP.Host, config.SMTP.Port, config.SMTP.User, config.SMTP.Password, config.SMTP.AdminEmail)
|
||||
emailService := services.NewEmailService(config.SMTP.Host, config.SMTP.Port, config.SMTP.User, config.SMTP.Password)
|
||||
var consentRepo repositories.ConsentRepositoryInterface = &repositories.ConsentRepository{}
|
||||
consentService := &services.ConsentService{Repo: consentRepo}
|
||||
|
||||
@@ -47,6 +47,7 @@ func Run() {
|
||||
userController := &controllers.UserController{Service: userService, EmailService: emailService, ConsentService: consentService, BankAccountService: bankAccountService, MembershipService: membershipService}
|
||||
membershipController := &controllers.MembershipController{Service: *membershipService}
|
||||
|
||||
contactController := &controllers.ContactController{EmailService: emailService}
|
||||
router := gin.Default()
|
||||
// gin.SetMode(gin.ReleaseMode)
|
||||
router.Static(config.Templates.StaticPath, "./style")
|
||||
@@ -55,7 +56,7 @@ func Run() {
|
||||
router.Use(gin.Logger())
|
||||
// router.Use(middlewares.LoggerMiddleware())
|
||||
|
||||
routes.RegisterRoutes(router, userController, membershipController)
|
||||
routes.RegisterRoutes(router, userController, membershipController, contactController)
|
||||
// create subrouter for teh authenticated area /account
|
||||
// also pthprefix matches everything below /account
|
||||
// accountRouter := router.PathPrefix("/account").Subrouter()
|
||||
|
||||
Reference in New Issue
Block a user