forked from tangled.org/core
Monorepo for Tangled

appview: pages: Add HXRefresh helper function.

authored by brookjeynes.dev and committed by Tangled 73be26e7 8b6482d2

Changed files
+6
appview
pages
+6
appview/pages/htmx.go
··· 15 15 w.Write([]byte(html)) 16 16 } 17 17 18 + // HxRefresh is a client-side full refresh of the page. 19 + func (s *Pages) HxRefresh(w http.ResponseWriter) { 20 + w.Header().Set("HX-Refresh", "true") 21 + w.WriteHeader(http.StatusOK) 22 + } 23 + 18 24 // HxRedirect is a full page reload with a new location. 19 25 func (s *Pages) HxRedirect(w http.ResponseWriter, location string) { 20 26 w.Header().Set("HX-Redirect", location)