Files
kontor/go/pkg/comics/artist_views.go
T
2025-04-29 12:52:55 +02:00

24 lines
576 B
Go

package comics
import (
"net/http"
"github.com/gin-gonic/gin"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/dao"
"gitlab.thpeetz.de/kontor/kontor-go/pkg/util"
)
const (
// ArtistPublisherTemplate defines name of template file for comics publishers
ArtistPublisherTemplate = "comics/publishers.html"
)
func showArtistList(c *gin.Context) {
var dao = ArtistDAO{Db: dao.KontorDb}
if artists, err := dao.FindAll(); err == nil {
util.Render(c, gin.H{"title": "Comic Artists", "payload": artists}, "artists.html")
} else {
c.AbortWithError(http.StatusNotFound, err)
}
}