Fleshing out some routes from notifications and messages
This commit is contained in:
@@ -22,6 +22,8 @@ package routes
|
||||
|
||||
import (
|
||||
accountHandlers "synlotto-website/internal/handlers/account"
|
||||
accountMessageHandlers "synlotto-website/internal/handlers/account/messages"
|
||||
accountNotificationHandlers "synlotto-website/internal/handlers/account/notifications"
|
||||
accountTicketHandlers "synlotto-website/internal/handlers/account/tickets"
|
||||
|
||||
"synlotto-website/internal/http/middleware"
|
||||
@@ -49,6 +51,25 @@ func RegisterAccountRoutes(app *bootstrap.App) {
|
||||
accAuth.GET("/logout", accountHandlers.Logout) // optional
|
||||
}
|
||||
|
||||
// Messages (auth-required)
|
||||
messages := r.Group("/account/messages")
|
||||
messages.Use(middleware.AuthMiddleware(), middleware.RequireAuth())
|
||||
{
|
||||
messages.GET("/", accountMessageHandlers.List)
|
||||
messages.GET("/add", accountMessageHandlers.AddGet)
|
||||
messages.POST("/add", accountMessageHandlers.AddPost)
|
||||
messages.GET("/archived", accountMessageHandlers.ArchivedList) // renders archived.html
|
||||
messages.GET("/:id", accountMessageHandlers.ReadGet) // renders read.html
|
||||
}
|
||||
|
||||
// Notifications (auth-required)
|
||||
notifications := r.Group("/account/notifications")
|
||||
notifications.Use(middleware.AuthMiddleware(), middleware.RequireAuth())
|
||||
{
|
||||
notifications.GET("/", accountNotificationHandlers.List)
|
||||
notifications.GET("/:id", accountNotificationHandlers.ReadGet) // renders read.html
|
||||
}
|
||||
|
||||
// Tickets (auth-required)
|
||||
tickets := r.Group("/account/tickets")
|
||||
tickets.Use(middleware.AuthMiddleware(), middleware.RequireAuth())
|
||||
|
||||
Reference in New Issue
Block a user