Continued work around getting messages and notifications cleaned up since moving to MySQL and changing to Gin, SCS, NoSurf.
This commit is contained in:
26
internal/handlers/account/messages/archive.go
Normal file
26
internal/handlers/account/messages/archive.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Package accountMessageHandler
|
||||
// Path: /internal/handlers/account/messages
|
||||
// File: archive.go
|
||||
|
||||
package accountMessageHandler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// GET /account/messages/archived
|
||||
// Renders: web/templates/account/messages/archived.html
|
||||
func (h *AccountMessageHandlers) ArchivedList(c *gin.Context) {
|
||||
userID := mustUserID(c)
|
||||
msgs, err := h.Svc.ListArchived(userID)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": "failed to load archived messages"})
|
||||
return
|
||||
}
|
||||
c.HTML(http.StatusOK, "account/messages/archived.html", gin.H{
|
||||
"title": "Archived Messages",
|
||||
"messages": msgs,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user