change templates
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
Gitea Actions Demo / build-and-test (push) Failing after 2m49s

This commit is contained in:
Thomas Peetz
2026-10-25 04:05:11 +01:00
parent 05555a7750
commit 2889927416
15 changed files with 255 additions and 139 deletions
+16
View File
@@ -1,11 +1,13 @@
package handlers
import (
"kontor-api-gin/internal/globals"
"kontor-api-gin/internal/models"
"kontor-api-gin/internal/repository"
"kontor-api-gin/internal/service"
"net/http"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
)
@@ -28,3 +30,17 @@ func (handler *PublisherHandler) List(c *gin.Context) {
dtos := models.ConvertPublishersToDtos(comics)
c.JSON(http.StatusOK, dtos)
}
func (handler *PublisherHandler) ListPage(c *gin.Context) {
session := sessions.Default(c)
user := session.Get(globals.UserKey)
publishers, err := handler.Service.List(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
data := globals.GetDefaultValues(user, "Publishers...")
data["title"] = "Kontor Comics"
data["publishers"] = publishers
c.HTML(http.StatusOK, "publishers", data)
}