Finishing up our response to user, and adding alerts
This commit is contained in:
@ -119,12 +119,17 @@ func (m *Repository) PostMakeReservation(w http.ResponseWriter, r *http.Request)
|
||||
http.Redirect(w, r, "/reservation-summary", http.StatusSeeOther)
|
||||
}
|
||||
|
||||
// ReservationSummary is the reservation summary page handler
|
||||
func (m *Repository) ReservationSummary(w http.ResponseWriter, r *http.Request) {
|
||||
reservation, ok := m.App.Session.Get(r.Context(), "reservation").(models.Reservation)
|
||||
if !ok {
|
||||
log.Println("connot get item from reservation")
|
||||
m.App.Session.Put(r.Context(), "error", "Can't get reservation from session")
|
||||
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
|
||||
}
|
||||
|
||||
m.App.Session.Remove(r.Context(), "reservation")
|
||||
|
||||
data := make(map[string]interface{})
|
||||
data["reservation"] = reservation
|
||||
|
||||
|
Reference in New Issue
Block a user