rename reservation to availability

This commit is contained in:
Muyao CHEN
2024-06-30 10:51:29 +02:00
parent a8b56b50db
commit 97b9898dfc
4 changed files with 12 additions and 12 deletions

View File

@ -71,13 +71,13 @@ func (m *Repository) MakeReservation(w http.ResponseWriter, r *http.Request) {
render.RenderTemplate(w, r, "make-reservation.page.tmpl", &models.TemplateData{})
}
// MakeReservation is the make reservation page handler
func (m *Repository) Reservation(w http.ResponseWriter, r *http.Request) {
render.RenderTemplate(w, r, "reservation.page.tmpl", &models.TemplateData{})
// Availability is the search for availability page handler
func (m *Repository) Availability(w http.ResponseWriter, r *http.Request) {
render.RenderTemplate(w, r, "availability.page.tmpl", &models.TemplateData{})
}
// MakeReservation is the make reservation page handler
func (m *Repository) PostReservation(w http.ResponseWriter, r *http.Request) {
// PostAvailability is the search for availability page handler
func (m *Repository) PostAvailability(w http.ResponseWriter, r *http.Request) {
start := r.Form.Get("start")
end := r.Form.Get("end")
fmt.Fprintf(w, "Posted to search availability from %s to %s", start, end)
@ -88,8 +88,8 @@ type responseJSON struct {
Message string `json:"message"`
}
// MakeReservation is the make reservation page handler
func (m *Repository) ReservationJSON(w http.ResponseWriter, r *http.Request) {
// AvailabilityJSON is the search for availability page handler
func (m *Repository) AvailabilityJSON(w http.ResponseWriter, r *http.Request) {
resp := responseJSON{
OK: "true",
Message: "Available!",