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:
jordi fita mas 2023-12-20 18:53:07 +01:00
parent 4a07d09557
commit d2858302ef
1 changed files with 4 additions and 1 deletions

View File

@ -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)