Server-side form validation 1
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"go-udemy-web-1/internal/config"
|
||||
"go-udemy-web-1/internal/forms"
|
||||
"go-udemy-web-1/internal/models"
|
||||
"go-udemy-web-1/internal/render"
|
||||
"log"
|
||||
@ -68,7 +69,13 @@ func (m *Repository) Majors(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// MakeReservation is the make reservation page handler
|
||||
func (m *Repository) MakeReservation(w http.ResponseWriter, r *http.Request) {
|
||||
render.RenderTemplate(w, r, "make-reservation.page.tmpl", &models.TemplateData{})
|
||||
render.RenderTemplate(w, r, "make-reservation.page.tmpl", &models.TemplateData{
|
||||
Form: forms.New(nil),
|
||||
})
|
||||
}
|
||||
|
||||
// PostMakeReservation is the make reservation page post handler
|
||||
func (m *Repository) PostMakeReservation(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// Availability is the search for availability page handler
|
||||
|
Reference in New Issue
Block a user