Simplified sending HTMX

This commit is contained in:
Caleb Gardner
2024-11-01 11:46:07 -05:00
parent 6925ff9e0c
commit 0f2b0f4f5d
4 changed files with 12 additions and 21 deletions
+1 -5
View File
@@ -14,9 +14,5 @@ func portfolioRequest(w http.ResponseWriter, r *http.Request) {
sendContent(w, r, "Error getting portfolio", "", "")
return
}
if r.Header.Get("Hx-Request") == "true" {
w.Write([]byte("<title>Portfolio</title>" + proj.FullHTMX(r.Context(), blogApp, selectedTech)))
} else {
sendContent(w, r, proj.FullHTMX(r.Context(), blogApp, selectedTech), "Portfolio", "")
}
sendContent(w, r, proj.FullHTMX(r.Context(), blogApp, selectedTech), "Portfolio", "")
}