Server Side form validation 4: check email

This commit is contained in:
Muyao CHEN
2024-07-01 13:47:52 +02:00
parent 87dfd26268
commit 6826634a01
4 changed files with 15 additions and 0 deletions

View File

@ -101,6 +101,7 @@ func (m *Repository) PostMakeReservation(w http.ResponseWriter, r *http.Request)
form.Required("first_name", "last_name", "email")
form.MinLength("first_name", 2, r)
form.IsEmail("email", r)
if !form.Valid() {
data := make(map[string]interface{})