You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
723 B
30 lines
723 B
package handlers
|
|
|
|
import (
|
|
"html/template"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func DashboardHandler(w http.ResponseWriter, r *http.Request) {
|
|
tmpl, err := template.ParseFiles(
|
|
"templates/layout.html",
|
|
"templates/dashboard.html",
|
|
"templates/partials/invoice_search.html",
|
|
"templates/partials/invoice_search_results.html",
|
|
)
|
|
if err != nil {
|
|
log.Printf("Template parsing error: %v", err)
|
|
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
|
return
|
|
}
|
|
|
|
data := struct{}{} // Empty struct as data
|
|
|
|
err = tmpl.ExecuteTemplate(w, "layout.html", data)
|
|
if err != nil {
|
|
log.Printf("Template execution error: %v", err)
|
|
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
|
return
|
|
}
|
|
}
|
|
|