Skip to content

Commit

Permalink
website/admin: template reload now does a full page reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Jun 19, 2024
1 parent ab12d6a commit 339c8d8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions website/admin/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,16 @@ func (TemplateReloadInput) TemplateName() string {

func (s *State) PostReloadTemplates(w http.ResponseWriter, r *http.Request) {
err := s.Templates.Reload()
err = s.TemplateExecutor.Execute(w, r, TemplateReloadInput{

input := NewHomeInput(r, s.Daypass)
input.TemplateReload = TemplateReloadInput{
Reloaded: err == nil,
Error: err,
})
}

err = s.TemplateExecutor.Execute(w, r, input)
if err != nil {
s.errorHandler(w, r, err, "failed to reload templates")
return
}
}

0 comments on commit 339c8d8

Please sign in to comment.