save
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user