19 lines
412 B
Go
19 lines
412 B
Go
package restgallery
|
|
|
|
import (
|
|
"log/slog"
|
|
"net/http"
|
|
|
|
"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/web/pages"
|
|
)
|
|
|
|
func (h *Handler) gallery(w http.ResponseWriter, r *http.Request) {
|
|
imgs, err := h.srv.GetGallery(r.Context(), 0)
|
|
if err != nil {
|
|
slog.Error("could not get images", "err", err)
|
|
w.WriteHeader(http.StatusInternalServerError)
|
|
return
|
|
}
|
|
h.r.Render(r.Context(), w, r, pages.Gallery(imgs))
|
|
}
|