This commit is contained in:
vxclutch
2026-05-27 11:14:26 -04:00
parent fb7d0ee80d
commit 6da1bb9fc1
4 changed files with 24 additions and 14 deletions

View File

@@ -2,8 +2,9 @@ package handlers
import (
"html/template"
"lash"
"net/http"
"lash"
)
type ShareData struct {
@@ -11,7 +12,10 @@ type ShareData struct {
FileName string
}
func (h ShareData) Handler(w http.ResponseWriter, r *http.Request) {
tmpl := template.Must(template.ParseFS(lash.Templates, "share.html"))
tmpl.ExecuteTemplate(w, "share.html", h)
func (h *ShareData) Handler(w http.ResponseWriter, r *http.Request) {
tmpl := template.Must(template.ParseFS(lash.Templates, "templates/share.html"))
if err := tmpl.ExecuteTemplate(w, "share.html", h); err != nil {
http.Error(w, "template render error: "+err.Error(), http.StatusInternalServerError)
}
}