Parse only campsite type and dates when getting booking form
If i parse everything, then the campsite type options no longer have their minimum values preset, meaning that people have to input each and every one of them.
This commit is contained in:
parent
4a07d09557
commit
d2858302ef
|
@ -38,7 +38,10 @@ func (h *PublicHandler) Handler(user *auth.User, company *auth.Company, conn *da
|
|||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
page := newPublicPage(r.Context(), company, conn, user.Locale)
|
||||
_ = page.Form.Parse(r) // Get query parameters, if any
|
||||
_ = r.ParseForm()
|
||||
page.Form.CampsiteType.FillValue(r)
|
||||
page.Form.ArrivalDate.FillValue(r)
|
||||
page.Form.DepartureDate.FillValue(r)
|
||||
page.MustRender(w, r, user, company, conn)
|
||||
case http.MethodPost:
|
||||
makeReservation(w, r, user, company, conn)
|
||||
|
|
Loading…
Reference in New Issue