Sprechstunden hinzufügen und durch einen E-Mail-Link bestätigen lassen
This commit is contained in:
parent
369f4ebcec
commit
78af58a51d
18 changed files with 291 additions and 29 deletions
24
controllers/confirmRequestHandler.go
Normal file
24
controllers/confirmRequestHandler.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue