Skip to content

Commit

Permalink
page refresh clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Sep 16, 2024
1 parent 297a0da commit 4e83d1a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions handler/htmx/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ var (
ErrYT = errors.New("youtube watch video id needs to be empty or 11 characters")
)

// pageRefresh is a helper function to set the HTTP HTMX header for the browser to refresh the page.
// pageRefresh is a helper function to set the HTTP [HTMX header] for the browser to refresh the page.
//
// [HTMX header]: https://htmx.org/reference/#response_headers
func pageRefresh(c echo.Context) echo.Context {
c.Response().Header().Set("HX-Refresh", "true")
res := c.Response()
const htmxRefresh = "HX-Refresh"
res.Header().Set(htmxRefresh, "true")
res.WriteHeader(http.StatusOK)
return c
}

Expand Down

0 comments on commit 4e83d1a

Please sign in to comment.