Sprechstunden hinzufügen und durch einen E-Mail-Link bestätigen lassen

This commit is contained in:
Gonne 2022-09-05 17:55:08 +02:00
parent 369f4ebcec
commit 78af58a51d
18 changed files with 291 additions and 29 deletions

View file

@ -0,0 +1,24 @@
package controllers
import (
"html/template"
"net/http"
)
func (b *BaseHandler) ConfirmRequestHandler(w http.ResponseWriter, req *http.Request) {
secret := req.FormValue("code")
request, err := b.requestRepo.FindBySecret(secret)
if err != nil {
w.WriteHeader(http.StatusNotFound)
tmpl, _ := template.ParseFiles("templates/requestNotFound.html")
tmpl.Execute(w, struct{}{})
}
err = b.requestRepo.Execute(request)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
tmpl, err := template.ParseFiles("templates/executeFailure.html")
tmpl.Execute(w, err)
}
}