Templates verbessert
This commit is contained in:
parent
56b4a3ab34
commit
e9e0cbf382
11 changed files with 53 additions and 42 deletions
|
@ -18,7 +18,14 @@ func (b *BaseHandler) ConfirmRequestHandler(w http.ResponseWriter, req *http.Req
|
|||
err = b.requestRepo.Execute(request)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
tmpl, err := template.ParseFiles("templates/executeFailure.html")
|
||||
tmpl.Execute(w, err)
|
||||
tmpl, _ := template.ParseFiles("templates/executeFailure.html")
|
||||
tmpl.Execute(w, err.Error())
|
||||
return
|
||||
}
|
||||
tmpl, err := template.ParseFiles("templates/executeSuccess.html")
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
}
|
||||
tmpl.Execute(w, struct{}{})
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue